From d72026f27e1ee367ae9afb21ee54540214e37f98 Mon Sep 17 00:00:00 2001 From: "Lukhnos D. Liu" Date: Sun, 9 Oct 2011 07:45:36 -0700 Subject: [PATCH] Update header to make externally-built framework/lib ARC-friendly. --- LFWebAPIKit/LFHTTPRequest.h | 28 ++++++++++++++---------- LFWebAPIKit/LFHTTPRequest.m | 2 +- Source/ObjectiveFlickr.h | 43 +++++++++++++++++++++++-------------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/LFWebAPIKit/LFHTTPRequest.h b/LFWebAPIKit/LFHTTPRequest.h index 14dc73f..57f1e55 100644 --- a/LFWebAPIKit/LFHTTPRequest.h +++ b/LFWebAPIKit/LFHTTPRequest.h @@ -99,14 +99,8 @@ 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 @@ -114,13 +108,9 @@ extern NSString *const LFHTTPRequestPOSTMethod; #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; @@ -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) diff --git a/LFWebAPIKit/LFHTTPRequest.m b/LFWebAPIKit/LFHTTPRequest.m index 5c65825..aed508f 100644 --- a/LFWebAPIKit/LFHTTPRequest.m +++ b/LFWebAPIKit/LFHTTPRequest.m @@ -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]; } diff --git a/Source/ObjectiveFlickr.h b/Source/ObjectiveFlickr.h index bd63e2a..457be35 100644 --- a/Source/ObjectiveFlickr.h +++ b/Source/ObjectiveFlickr.h @@ -53,8 +53,6 @@ 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; @@ -62,6 +60,23 @@ extern NSString *const OFFlickrDeletePermission; - (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; @@ -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 @@ -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; @@ -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