Skip to content

Commit

Permalink
Update header to make externally-built framework/lib ARC-friendly.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukhnos committed Oct 9, 2011
1 parent 0d2ef87 commit d72026f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 28 deletions.
28 changes: 17 additions & 11 deletions LFWebAPIKit/LFHTTPRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,18 @@ extern NSString *const LFHTTPRequestPOSTMethod;

- (NSData *)getReceivedDataAndDetachFromRequest;

- (NSDictionary *)requestHeader;
- (void)setRequestHeader:(NSDictionary *)requestHeader;
- (NSTimeInterval)timeoutInterval;
- (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval;
- (NSString *)userAgent;
- (void)setUserAgent:(NSString *)userAgent;
- (NSString *)contentType;
- (void)setContentType:(NSString *)contentType;
- (NSData *)receivedData;
- (NSString *)receivedContentType;
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
- (NSUInteger)expectedDataLength;
#else
- (unsigned int)expectedDataLength;
#endif
- (id)delegate;
- (void)setDelegate:(id)delegate;

- (void)setSessionInfo:(id)aSessionInfo;
- (id)sessionInfo;

#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4

@property (copy) NSDictionary *requestHeader;
@property (assign) NSTimeInterval timeoutInterval;
@property (copy) NSString *userAgent;
Expand All @@ -131,7 +121,23 @@ extern NSString *const LFHTTPRequestPOSTMethod;
@property (retain) id sessionInfo;
@property (assign) BOOL shouldWaitUntilDone;
@property (readonly) BOOL isRunning;

#else

- (NSDictionary *)requestHeader;
- (void)setRequestHeader:(NSDictionary *)requestHeader;
- (NSString *)userAgent;
- (void)setUserAgent:(NSString *)userAgent;
- (NSString *)contentType;
- (void)setContentType:(NSString *)contentType;
- (id)delegate;
- (void)setDelegate:(id)delegate;
- (void)setSessionInfo:(id)aSessionInfo;
- (id)sessionInfo;


#endif

@end

@interface NSObject (LFHTTPRequestDelegate)
Expand Down
2 changes: 1 addition & 1 deletion LFWebAPIKit/LFHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ - (BOOL)_performMethod:(NSString *)methodName onURL:(NSURL *)url withData:(NSDat
BOOL isReentrant = (_synchronousMessagePort != nil);

if (!isReentrant) {
_synchronousMessagePort = [[NSPort port] retain];
_synchronousMessagePort = (NSMessagePort *)[[NSPort port] retain];
[currentRunLoop addPort:_synchronousMessagePort forMode:currentMode];
}

Expand Down
43 changes: 27 additions & 16 deletions Source/ObjectiveFlickr.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,30 @@ extern NSString *const OFFlickrDeletePermission;
}
- (id)initWithAPIKey:(NSString *)inKey sharedSecret:(NSString *)inSharedSecret;

- (void)setAuthToken:(NSString *)inAuthToken;
- (NSString *)authToken;

// URL provisioning
- (NSURL *)photoSourceURLFromDictionary:(NSDictionary *)inDictionary size:(NSString *)inSizeModifier;
- (NSURL *)photoWebPageURLFromDictionary:(NSDictionary *)inDictionary;
- (NSURL *)loginURLFromFrobDictionary:(NSDictionary *)inFrob requestedPermission:(NSString *)inPermission;

// API endpoints

#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
@property (nonatomic, readonly) NSString *key;
@property (nonatomic, readonly) NSString *sharedSecret;
@property (nonatomic, retain) NSString *authToken;

@property (nonatomic, retain) NSString *RESTAPIEndpoint;
@property (nonatomic, retain) NSString *photoSource;
@property (nonatomic, retain) NSString *photoWebPageSource;
@property (nonatomic, retain) NSString *authEndpoint;
@property (nonatomic, retain) NSString *uploadEndpoint;
#else

- (void)setAuthToken:(NSString *)inAuthToken;
- (NSString *)authToken;


- (void)setRESTAPIEndpoint:(NSString *)inEndpoint;
- (NSString *)RESTAPIEndpoint;

Expand All @@ -74,16 +89,8 @@ extern NSString *const OFFlickrDeletePermission;
- (void)setUploadEndpoint:(NSString *)inEndpoint;
- (NSString *)uploadEndpoint;

#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
@property (nonatomic, readonly) NSString *key;
@property (nonatomic, readonly) NSString *sharedSecret;
@property (nonatomic, retain) NSString *authToken;

@property (nonatomic, retain) NSString *RESTAPIEndpoint;
@property (nonatomic, retain) NSString *photoSource;
@property (nonatomic, retain) NSString *photoWebPageSource;
@property (nonatomic, retain) NSString *authEndpoint;
@property (nonatomic, retain) NSString *uploadEndpoint;

#endif
@end

Expand Down Expand Up @@ -134,11 +141,6 @@ typedef id OFFlickrAPIRequestDelegateType;
- (id)initWithAPIContext:(OFFlickrAPIContext *)inContext;
- (OFFlickrAPIContext *)context;

- (OFFlickrAPIRequestDelegateType)delegate;
- (void)setDelegate:(OFFlickrAPIRequestDelegateType)inDelegate;

- (id)sessionInfo;
- (void)setSessionInfo:(id)inInfo;

- (NSTimeInterval)requestTimeoutInterval;
- (void)setRequestTimeoutInterval:(NSTimeInterval)inTimeInterval;
Expand All @@ -157,5 +159,14 @@ typedef id OFFlickrAPIRequestDelegateType;
@property (nonatomic, assign) OFFlickrAPIRequestDelegateType delegate;
@property (nonatomic, retain) id sessionInfo;
@property (nonatomic, assign) NSTimeInterval requestTimeoutInterval;
#else

- (OFFlickrAPIRequestDelegateType)delegate;
- (void)setDelegate:(OFFlickrAPIRequestDelegateType)inDelegate;

- (id)sessionInfo;
- (void)setSessionInfo:(id)inInfo;

#endif

@end

0 comments on commit d72026f

Please sign in to comment.