First pass at converting to ARC
This commit is contained in:
parent
b420c181ed
commit
f1b3101a63
22 changed files with 197 additions and 274 deletions
|
|
@ -134,7 +134,7 @@ extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *paramete
|
||||||
/**
|
/**
|
||||||
The url used as the base for paths specified in methods such as `getPath:parameteres:success:failure`
|
The url used as the base for paths specified in methods such as `getPath:parameteres:success:failure`
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSURL *baseURL;
|
@property (readonly, nonatomic) NSURL *baseURL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The string encoding used in constructing url requests. This is `NSUTF8StringEncoding` by default.
|
The string encoding used in constructing url requests. This is `NSUTF8StringEncoding` by default.
|
||||||
|
|
@ -151,7 +151,7 @@ extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *paramete
|
||||||
/**
|
/**
|
||||||
The operation queue which manages operations enqueued by the HTTP client.
|
The operation queue which manages operations enqueued by the HTTP client.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSOperationQueue *operationQueue;
|
@property (readonly, nonatomic) NSOperationQueue *operationQueue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The reachability status from the device to the current `baseURL` of the `AFHTTPClient`.
|
The reachability status from the device to the current `baseURL` of the `AFHTTPClient`.
|
||||||
|
|
|
||||||
|
|
@ -90,25 +90,21 @@ static NSString * AFBase64EncodedStringFromString(NSString *string) {
|
||||||
output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '=';
|
output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '=';
|
||||||
}
|
}
|
||||||
|
|
||||||
return [[[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding] autorelease];
|
return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
|
NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
|
||||||
static NSString * const kAFLegalCharactersToBeEscaped = @"?!@#$^&%*+=,:;'\"`<>()[]{}/\\|~ ";
|
static NSString * const kAFLegalCharactersToBeEscaped = @"?!@#$^&%*+=,:;'\"`<>()[]{}/\\|~ ";
|
||||||
|
|
||||||
return [(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, (CFStringRef)kAFLegalCharactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding)) autorelease];
|
return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFLegalCharactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding));
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
@interface AFQueryStringComponent : NSObject {
|
@interface AFQueryStringComponent : NSObject
|
||||||
@private
|
|
||||||
NSString *_key;
|
|
||||||
NSString *_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (readwrite, nonatomic, retain) id key;
|
@property (readwrite, nonatomic) id key;
|
||||||
@property (readwrite, nonatomic, retain) id value;
|
@property (readwrite, nonatomic) id value;
|
||||||
|
|
||||||
- (id)initWithKey:(id)key value:(id)value;
|
- (id)initWithKey:(id)key value:(id)value;
|
||||||
- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding;
|
- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding;
|
||||||
|
|
@ -125,18 +121,12 @@ NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEn
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.key = key;
|
_key = key;
|
||||||
self.value = value;
|
_value = value;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[_key release];
|
|
||||||
[_value release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding {
|
- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding {
|
||||||
return [NSString stringWithFormat:@"%@=%@", self.key, AFURLEncodedStringFromStringWithEncoding([self.value description], stringEncoding)];
|
return [NSString stringWithFormat:@"%@=%@", self.key, AFURLEncodedStringFromStringWithEncoding([self.value description], stringEncoding)];
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +156,7 @@ NSArray * AFQueryStringComponentsFromKeyAndValue(NSString *key, id value) {
|
||||||
} else if([value isKindOfClass:[NSArray class]]) {
|
} else if([value isKindOfClass:[NSArray class]]) {
|
||||||
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndArrayValue(key, value)];
|
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndArrayValue(key, value)];
|
||||||
} else {
|
} else {
|
||||||
[mutableQueryStringComponents addObject:[[[AFQueryStringComponent alloc] initWithKey:key value:value] autorelease]];
|
[mutableQueryStringComponents addObject:[[AFQueryStringComponent alloc] initWithKey:key value:value]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return mutableQueryStringComponents;
|
return mutableQueryStringComponents;
|
||||||
|
|
@ -197,7 +187,7 @@ static NSString * AFJSONStringFromParameters(NSDictionary *parameters) {
|
||||||
NSData *JSONData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error];;
|
NSData *JSONData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error];;
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
return [[[NSString alloc] initWithData:JSONData encoding:NSUTF8StringEncoding] autorelease];
|
return [[NSString alloc] initWithData:JSONData encoding:NSUTF8StringEncoding];
|
||||||
} else {
|
} else {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
@ -209,17 +199,17 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
||||||
|
|
||||||
NSData *propertyListData = [NSPropertyListSerialization dataWithPropertyList:parameters format:NSPropertyListXMLFormat_v1_0 options:0 error:&error];
|
NSData *propertyListData = [NSPropertyListSerialization dataWithPropertyList:parameters format:NSPropertyListXMLFormat_v1_0 options:0 error:&error];
|
||||||
if (!error) {
|
if (!error) {
|
||||||
propertyListString = [[[NSString alloc] initWithData:propertyListData encoding:NSUTF8StringEncoding] autorelease];
|
propertyListString = [[NSString alloc] initWithData:propertyListData encoding:NSUTF8StringEncoding] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return propertyListString;
|
return propertyListString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFHTTPClient ()
|
@interface AFHTTPClient ()
|
||||||
@property (readwrite, nonatomic, retain) NSURL *baseURL;
|
@property (readwrite, nonatomic) NSURL *baseURL;
|
||||||
@property (readwrite, nonatomic, retain) NSMutableArray *registeredHTTPOperationClassNames;
|
@property (readwrite, nonatomic) NSMutableArray *registeredHTTPOperationClassNames;
|
||||||
@property (readwrite, nonatomic, retain) NSMutableDictionary *defaultHeaders;
|
@property (readwrite, nonatomic) NSMutableDictionary *defaultHeaders;
|
||||||
@property (readwrite, nonatomic, retain) NSOperationQueue *operationQueue;
|
@property (readwrite, nonatomic) NSOperationQueue *operationQueue;
|
||||||
#ifdef _SYSTEMCONFIGURATION_H
|
#ifdef _SYSTEMCONFIGURATION_H
|
||||||
@property (readwrite, nonatomic, assign) AFNetworkReachabilityRef networkReachability;
|
@property (readwrite, nonatomic, assign) AFNetworkReachabilityRef networkReachability;
|
||||||
@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
|
@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
|
||||||
|
|
@ -246,7 +236,7 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
+ (AFHTTPClient *)clientWithBaseURL:(NSURL *)url {
|
+ (AFHTTPClient *)clientWithBaseURL:(NSURL *)url {
|
||||||
return [[[self alloc] initWithBaseURL:url] autorelease];
|
return [[self alloc] initWithBaseURL:url];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithBaseURL:(NSURL *)url {
|
- (id)initWithBaseURL:(NSURL *)url {
|
||||||
|
|
@ -283,7 +273,7 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
||||||
[self startMonitoringNetworkReachability];
|
[self startMonitoringNetworkReachability];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
self.operationQueue = [[[NSOperationQueue alloc] init] autorelease];
|
self.operationQueue = [[NSOperationQueue alloc] init];
|
||||||
[self.operationQueue setMaxConcurrentOperationCount:kAFHTTPClientDefaultMaxConcurrentOperationCount];
|
[self.operationQueue setMaxConcurrentOperationCount:kAFHTTPClientDefaultMaxConcurrentOperationCount];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
@ -292,15 +282,9 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
#ifdef _SYSTEMCONFIGURATION_H
|
#ifdef _SYSTEMCONFIGURATION_H
|
||||||
[self stopMonitoringNetworkReachability];
|
[self stopMonitoringNetworkReachability];
|
||||||
[_networkReachabilityStatusBlock release];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[_baseURL release];
|
|
||||||
[_registeredHTTPOperationClassNames release];
|
|
||||||
[_defaultHeaders release];
|
|
||||||
[_operationQueue release];
|
|
||||||
|
|
||||||
[super dealloc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
|
|
@ -340,7 +324,7 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork
|
||||||
|
|
||||||
static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
|
static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
|
||||||
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
|
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
|
||||||
AFNetworkReachabilityStatusBlock block = (AFNetworkReachabilityStatusBlock)info;
|
AFNetworkReachabilityStatusBlock block = (__bridge AFNetworkReachabilityStatusBlock)info;
|
||||||
if (block) {
|
if (block) {
|
||||||
block(status);
|
block(status);
|
||||||
}
|
}
|
||||||
|
|
@ -349,11 +333,10 @@ static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused targ
|
||||||
}
|
}
|
||||||
|
|
||||||
static const void * AFNetworkReachabilityRetainCallback(const void *info) {
|
static const void * AFNetworkReachabilityRetainCallback(const void *info) {
|
||||||
return [(AFNetworkReachabilityStatusBlock)info copy];
|
return (__bridge_retained const void *)([(__bridge AFNetworkReachabilityStatusBlock)info copy]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
[(AFNetworkReachabilityStatusBlock)info release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)startMonitoringNetworkReachability {
|
- (void)startMonitoringNetworkReachability {
|
||||||
|
|
@ -372,7 +355,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SCNetworkReachabilityContext context = {0, callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
|
SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
|
||||||
SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
|
SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
|
||||||
SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), (CFStringRef)NSRunLoopCommonModes);
|
SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), (CFStringRef)NSRunLoopCommonModes);
|
||||||
|
|
||||||
|
|
@ -449,7 +432,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
parameters:(NSDictionary *)parameters
|
parameters:(NSDictionary *)parameters
|
||||||
{
|
{
|
||||||
NSURL *url = [NSURL URLWithString:path relativeToURL:self.baseURL];
|
NSURL *url = [NSURL URLWithString:path relativeToURL:self.baseURL];
|
||||||
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] initWithURL:url] autorelease];
|
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
|
||||||
[request setHTTPMethod:method];
|
[request setHTTPMethod:method];
|
||||||
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
||||||
|
|
||||||
|
|
@ -462,7 +445,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:[path rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding)]];
|
url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:[path rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding)]];
|
||||||
[request setURL:url];
|
[request setURL:url];
|
||||||
} else {
|
} else {
|
||||||
NSString *charset = (NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(self.stringEncoding));
|
NSString *charset = (__bridge NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(self.stringEncoding));
|
||||||
switch (self.parameterEncoding) {
|
switch (self.parameterEncoding) {
|
||||||
case AFFormURLParameterEncoding:;
|
case AFFormURLParameterEncoding:;
|
||||||
[request setValue:[NSString stringWithFormat:@"application/x-www-form-urlencoded; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
|
[request setValue:[NSString stringWithFormat:@"application/x-www-form-urlencoded; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
|
||||||
|
|
@ -489,7 +472,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData>formData))block
|
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData>formData))block
|
||||||
{
|
{
|
||||||
NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil];
|
NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil];
|
||||||
__block AFMultipartFormData *formData = [[[AFMultipartFormData alloc] initWithURLRequest:request stringEncoding:self.stringEncoding] autorelease];
|
__block AFMultipartFormData *formData = [[AFMultipartFormData alloc] initWithURLRequest:request stringEncoding:self.stringEncoding];
|
||||||
|
|
||||||
if (parameters) {
|
if (parameters) {
|
||||||
for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) {
|
for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) {
|
||||||
|
|
@ -523,12 +506,12 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
while (!operation && (className = [enumerator nextObject])) {
|
while (!operation && (className = [enumerator nextObject])) {
|
||||||
Class op_class = NSClassFromString(className);
|
Class op_class = NSClassFromString(className);
|
||||||
if (op_class && [op_class canProcessRequest:urlRequest]) {
|
if (op_class && [op_class canProcessRequest:urlRequest]) {
|
||||||
operation = [[(AFHTTPRequestOperation *)[op_class alloc] initWithRequest:urlRequest] autorelease];
|
operation = [(AFHTTPRequestOperation *)[op_class alloc] initWithRequest:urlRequest];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!operation) {
|
if (!operation) {
|
||||||
operation = [[[AFHTTPRequestOperation alloc] initWithRequest:urlRequest] autorelease];
|
operation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
|
||||||
}
|
}
|
||||||
|
|
||||||
[operation setCompletionBlockWithSuccess:success failure:failure];
|
[operation setCompletionBlockWithSuccess:success failure:failure];
|
||||||
|
|
@ -584,7 +567,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
NSPredicate *finishedOperationPredicate = [NSPredicate predicateWithFormat:@"isFinished == YES"];
|
NSPredicate *finishedOperationPredicate = [NSPredicate predicateWithFormat:@"isFinished == YES"];
|
||||||
|
|
||||||
for (AFHTTPRequestOperation *operation in operations) {
|
for (AFHTTPRequestOperation *operation in operations) {
|
||||||
AFCompletionBlock originalCompletionBlock = [[operation.completionBlock copy] autorelease];
|
AFCompletionBlock originalCompletionBlock = [operation.completionBlock copy];
|
||||||
operation.completionBlock = ^{
|
operation.completionBlock = ^{
|
||||||
dispatch_queue_t queue = operation.successCallbackQueue ? operation.successCallbackQueue : dispatch_get_main_queue();
|
dispatch_queue_t queue = operation.successCallbackQueue ? operation.successCallbackQueue : dispatch_get_main_queue();
|
||||||
dispatch_group_async(dispatchGroup, queue, ^{
|
dispatch_group_async(dispatchGroup, queue, ^{
|
||||||
|
|
@ -698,9 +681,9 @@ static inline NSString * AFMultipartFormFinalBoundary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFMultipartFormData ()
|
@interface AFMultipartFormData ()
|
||||||
@property (readwrite, nonatomic, retain) NSMutableURLRequest *request;
|
@property (readwrite, nonatomic) NSMutableURLRequest *request;
|
||||||
@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding;
|
@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding;
|
||||||
@property (readwrite, nonatomic, retain) NSOutputStream *outputStream;
|
@property (readwrite, nonatomic) NSOutputStream *outputStream;
|
||||||
@property (readwrite, nonatomic, copy) NSString *temporaryFilePath;
|
@property (readwrite, nonatomic, copy) NSString *temporaryFilePath;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
@ -732,16 +715,11 @@ static inline NSString * AFMultipartFormFinalBoundary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[_request release];
|
|
||||||
|
|
||||||
if (_outputStream) {
|
if (_outputStream) {
|
||||||
[_outputStream close];
|
[_outputStream close];
|
||||||
[_outputStream release];
|
|
||||||
_outputStream = nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[_temporaryFilePath release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSMutableURLRequest *)requestByFinalizingMultipartFormData {
|
- (NSMutableURLRequest *)requestByFinalizingMultipartFormData {
|
||||||
|
|
@ -816,7 +794,7 @@ static inline NSString * AFMultipartFormFinalBoundary() {
|
||||||
[userInfo setValue:fileURL forKey:NSURLErrorFailingURLErrorKey];
|
[userInfo setValue:fileURL forKey:NSURLErrorFailingURLErrorKey];
|
||||||
[userInfo setValue:NSLocalizedString(@"Expected URL to be a file URL", nil) forKey:NSLocalizedFailureReasonErrorKey];
|
[userInfo setValue:NSLocalizedString(@"Expected URL to be a file URL", nil) forKey:NSLocalizedFailureReasonErrorKey];
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
*error = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadURL userInfo:userInfo] autorelease];
|
*error = [[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadURL userInfo:userInfo];
|
||||||
}
|
}
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ extern NSString * AFCreateIncompleteDownloadDirectoryPath(void);
|
||||||
/**
|
/**
|
||||||
The last HTTP response received by the operation's connection.
|
The last HTTP response received by the operation's connection.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSHTTPURLResponse *response;
|
@property (readonly, nonatomic, strong) NSHTTPURLResponse *response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set a target file for the response, will stream directly into this destination.
|
Set a target file for the response, will stream directly into this destination.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ NSSet * AFContentTypesFromHTTPHeader(NSString *string) {
|
||||||
static NSCharacterSet *_skippedCharacterSet = nil;
|
static NSCharacterSet *_skippedCharacterSet = nil;
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
_skippedCharacterSet = [[NSCharacterSet characterSetWithCharactersInString:@" ,"] retain];
|
_skippedCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@" ,"];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!string) {
|
if (!string) {
|
||||||
|
|
@ -96,14 +96,13 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
NSString *tempDirectory = NSTemporaryDirectory();
|
NSString *tempDirectory = NSTemporaryDirectory();
|
||||||
incompleteDownloadPath = [[tempDirectory stringByAppendingPathComponent:kAFNetworkingIncompleteDownloadDirectoryName] retain];
|
incompleteDownloadPath = [tempDirectory stringByAppendingPathComponent:kAFNetworkingIncompleteDownloadDirectoryName];
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSFileManager *fileMan = [[NSFileManager alloc] init];
|
NSFileManager *fileMan = [[NSFileManager alloc] init];
|
||||||
if(![fileMan createDirectoryAtPath:incompleteDownloadPath withIntermediateDirectories:YES attributes:nil error:&error]) {
|
if(![fileMan createDirectoryAtPath:incompleteDownloadPath withIntermediateDirectories:YES attributes:nil error:&error]) {
|
||||||
NSLog(@"Failed to create incomplete downloads directory at %@", incompleteDownloadPath);
|
NSLog(@"Failed to create incomplete downloads directory at %@", incompleteDownloadPath);
|
||||||
}
|
}
|
||||||
[fileMan release];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return incompleteDownloadPath;
|
return incompleteDownloadPath;
|
||||||
|
|
@ -112,9 +111,9 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
@interface AFHTTPRequestOperation ()
|
@interface AFHTTPRequestOperation ()
|
||||||
@property (readwrite, nonatomic, retain) NSURLRequest *request;
|
@property (readwrite, nonatomic, strong) NSURLRequest *request;
|
||||||
@property (readwrite, nonatomic, retain) NSHTTPURLResponse *response;
|
@property (readwrite, nonatomic, strong) NSHTTPURLResponse *response;
|
||||||
@property (readwrite, nonatomic, retain) NSError *HTTPError;
|
@property (readwrite, nonatomic, strong) NSError *HTTPError;
|
||||||
@property (assign) long long totalContentLength;
|
@property (assign) long long totalContentLength;
|
||||||
@property (assign) long long offsetContentLength;
|
@property (assign) long long offsetContentLength;
|
||||||
@end
|
@end
|
||||||
|
|
@ -130,7 +129,6 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
@dynamic response;
|
@dynamic response;
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[_HTTPError release];
|
|
||||||
|
|
||||||
if (_successCallbackQueue) {
|
if (_successCallbackQueue) {
|
||||||
dispatch_release(_successCallbackQueue);
|
dispatch_release(_successCallbackQueue);
|
||||||
|
|
@ -142,7 +140,6 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
_failureCallbackQueue = NULL;
|
_failureCallbackQueue = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
[super dealloc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSError *)error {
|
- (NSError *)error {
|
||||||
|
|
@ -152,13 +149,13 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected status code in (%@), got %d", nil), AFStringFromIndexSet([[self class] acceptableStatusCodes]), [self.response statusCode]] forKey:NSLocalizedDescriptionKey];
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected status code in (%@), got %d", nil), AFStringFromIndexSet([[self class] acceptableStatusCodes]), [self.response statusCode]] forKey:NSLocalizedDescriptionKey];
|
||||||
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
||||||
|
|
||||||
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo] autorelease];
|
self.HTTPError = [[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo];
|
||||||
} else if ([self.responseData length] > 0 && ![self hasAcceptableContentType]) { // Don't invalidate content type if there is no content
|
} else if ([self.responseData length] > 0 && ![self hasAcceptableContentType]) { // Don't invalidate content type if there is no content
|
||||||
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
||||||
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected content type %@, got %@", nil), [[self class] acceptableContentTypes], [self.response MIMEType]] forKey:NSLocalizedDescriptionKey];
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected content type %@, got %@", nil), [[self class] acceptableContentTypes], [self.response MIMEType]] forKey:NSLocalizedDescriptionKey];
|
||||||
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
||||||
|
|
||||||
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo] autorelease];
|
self.HTTPError = [[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,7 +174,7 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
offset = [[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length];
|
offset = [[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableURLRequest *mutableURLRequest = [[self.request mutableCopy] autorelease];
|
NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy];
|
||||||
if ([[self.response allHeaderFields] valueForKey:@"ETag"]) {
|
if ([[self.response allHeaderFields] valueForKey:@"ETag"]) {
|
||||||
[mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"];
|
[mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"];
|
||||||
}
|
}
|
||||||
|
|
@ -226,21 +223,22 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
||||||
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
||||||
{
|
{
|
||||||
|
__weak AFHTTPRequestOperation *weakSelf = self;
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if ([self isCancelled]) {
|
if ([weakSelf isCancelled]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.error) {
|
if (weakSelf.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (success) {
|
if (success) {
|
||||||
dispatch_async(self.successCallbackQueue ? self.successCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.successCallbackQueue ? weakSelf.successCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
success(self, self.responseData);
|
success(weakSelf, weakSelf.responseData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -249,8 +247,7 @@ NSString * AFCreateIncompleteDownloadDirectoryPath(void) {
|
||||||
|
|
||||||
- (void)setResponseFilePath:(NSString *)responseFilePath {
|
- (void)setResponseFilePath:(NSString *)responseFilePath {
|
||||||
if ([self isReady] && responseFilePath != _responseFilePath) {
|
if ([self isReady] && responseFilePath != _responseFilePath) {
|
||||||
[_responseFilePath release];
|
_responseFilePath = responseFilePath;
|
||||||
_responseFilePath = [responseFilePath retain];
|
|
||||||
|
|
||||||
if (responseFilePath) {
|
if (responseFilePath) {
|
||||||
self.outputStream = [NSOutputStream outputStreamToFileAtPath:responseFilePath append:NO];
|
self.outputStream = [NSOutputStream outputStreamToFileAtPath:responseFilePath append:NO];
|
||||||
|
|
@ -271,7 +268,7 @@ static id AFStaticClassValueImplementation(id self, SEL _cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)addAcceptableStatusCodes:(NSIndexSet *)statusCodes {
|
+ (void)addAcceptableStatusCodes:(NSIndexSet *)statusCodes {
|
||||||
NSMutableIndexSet *mutableStatusCodes = [[[NSMutableIndexSet alloc] initWithIndexSet:[self acceptableStatusCodes]] autorelease];
|
NSMutableIndexSet *mutableStatusCodes = [[NSMutableIndexSet alloc] initWithIndexSet:[self acceptableStatusCodes]];
|
||||||
[mutableStatusCodes addIndexes:statusCodes];
|
[mutableStatusCodes addIndexes:statusCodes];
|
||||||
SEL selector = @selector(acceptableStatusCodes);
|
SEL selector = @selector(acceptableStatusCodes);
|
||||||
AFSwizzleClassMethodWithImplementation([self class], selector, (IMP)AFStaticClassValueImplementation);
|
AFSwizzleClassMethodWithImplementation([self class], selector, (IMP)AFStaticClassValueImplementation);
|
||||||
|
|
@ -283,7 +280,7 @@ static id AFStaticClassValueImplementation(id self, SEL _cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)addAcceptableContentTypes:(NSSet *)contentTypes {
|
+ (void)addAcceptableContentTypes:(NSSet *)contentTypes {
|
||||||
NSMutableSet *mutableContentTypes = [[[NSMutableSet alloc] initWithSet:[self acceptableContentTypes] copyItems:YES] autorelease];
|
NSMutableSet *mutableContentTypes = [[NSMutableSet alloc] initWithSet:[self acceptableContentTypes] copyItems:YES];
|
||||||
[mutableContentTypes unionSet:contentTypes];
|
[mutableContentTypes unionSet:contentTypes];
|
||||||
SEL selector = @selector(acceptableContentTypes);
|
SEL selector = @selector(acceptableContentTypes);
|
||||||
AFSwizzleClassMethodWithImplementation([self class], selector, (IMP)AFStaticClassValueImplementation);
|
AFSwizzleClassMethodWithImplementation([self class], selector, (IMP)AFStaticClassValueImplementation);
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
An image constructed from the response data. If an error occurs during the request, `nil` will be returned, and the `error` property will be set to the error.
|
An image constructed from the response data. If an error occurs during the request, `nil` will be returned, and the `error` property will be set to the error.
|
||||||
*/
|
*/
|
||||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||||
@property (readonly, nonatomic, retain) UIImage *responseImage;
|
@property (readonly, nonatomic) UIImage *responseImage;
|
||||||
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
|
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
@property (readonly, nonatomic, retain) NSImage *responseImage;
|
@property (readonly, nonatomic, retain) NSImage *responseImage;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
|
|
||||||
@interface AFImageRequestOperation ()
|
@interface AFImageRequestOperation ()
|
||||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||||
@property (readwrite, nonatomic, retain) UIImage *responseImage;
|
@property (readwrite, nonatomic) UIImage *responseImage;
|
||||||
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
|
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
@property (readwrite, nonatomic, retain) NSImage *responseImage;
|
@property (readwrite, nonatomic, retain) NSImage *responseImage;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -74,7 +74,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
|
||||||
{
|
{
|
||||||
AFImageRequestOperation *requestOperation = [[[AFImageRequestOperation alloc] initWithRequest:urlRequest] autorelease];
|
AFImageRequestOperation *requestOperation = [[AFImageRequestOperation alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
UIImage *image = responseObject;
|
UIImage *image = responseObject;
|
||||||
|
|
@ -105,7 +105,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSImage *image))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSImage *image))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
|
||||||
{
|
{
|
||||||
AFImageRequestOperation *requestOperation = [[[AFImageRequestOperation alloc] initWithRequest:urlRequest] autorelease];
|
AFImageRequestOperation *requestOperation = [[AFImageRequestOperation alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
NSImage *image = responseObject;
|
NSImage *image = responseObject;
|
||||||
|
|
@ -144,10 +144,6 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[_responseImage release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||||
- (UIImage *)responseImage {
|
- (UIImage *)responseImage {
|
||||||
|
|
@ -174,9 +170,8 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
if (!_responseImage && [self.responseData length] > 0 && [self isFinished]) {
|
if (!_responseImage && [self.responseData length] > 0 && [self isFinished]) {
|
||||||
// Ensure that the image is set to it's correct pixel width and height
|
// Ensure that the image is set to it's correct pixel width and height
|
||||||
NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:self.responseData];
|
NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:self.responseData];
|
||||||
self.responseImage = [[[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])] autorelease];
|
self.responseImage = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])];
|
||||||
[self.responseImage addRepresentation:bitimage];
|
[self.responseImage addRepresentation:bitimage];
|
||||||
[bitimage release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _responseImage;
|
return _responseImage;
|
||||||
|
|
@ -202,16 +197,17 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
||||||
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
||||||
{
|
{
|
||||||
|
__weak AFImageRequestOperation *weakSelf = self;
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if ([self isCancelled]) {
|
if ([weakSelf isCancelled]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
||||||
if (self.error) {
|
if (weakSelf.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -222,10 +218,10 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
NSImage *image = nil;
|
NSImage *image = nil;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
image = self.responseImage;
|
image = weakSelf.responseImage;
|
||||||
|
|
||||||
dispatch_async(self.successCallbackQueue ? self.successCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.successCallbackQueue ? weakSelf.successCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
success(self, image);
|
success(weakSelf, image);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
/**
|
/**
|
||||||
A JSON object constructed from the response data. If an error occurs while parsing, `nil` will be returned, and the `error` property will be set to the error.
|
A JSON object constructed from the response data. If an error occurs while parsing, `nil` will be returned, and the `error` property will be set to the error.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) id responseJSON;
|
@property (readonly, nonatomic) id responseJSON;
|
||||||
|
|
||||||
///----------------------------------
|
///----------------------------------
|
||||||
/// @name Creating Request Operations
|
/// @name Creating Request Operations
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ static dispatch_queue_t json_request_operation_processing_queue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFJSONRequestOperation ()
|
@interface AFJSONRequestOperation ()
|
||||||
@property (readwrite, nonatomic, retain) id responseJSON;
|
@property (readwrite, nonatomic) id responseJSON;
|
||||||
@property (readwrite, nonatomic, retain) NSError *JSONError;
|
@property (readwrite, nonatomic) NSError *JSONError;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation AFJSONRequestOperation
|
@implementation AFJSONRequestOperation
|
||||||
|
|
@ -44,7 +44,7 @@ static dispatch_queue_t json_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id JSON))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id JSON))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON))failure
|
||||||
{
|
{
|
||||||
AFJSONRequestOperation *requestOperation = [[[self alloc] initWithRequest:urlRequest] autorelease];
|
AFJSONRequestOperation *requestOperation = [[self alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
success(operation.request, operation.response, responseObject);
|
success(operation.request, operation.response, responseObject);
|
||||||
|
|
@ -58,11 +58,6 @@ static dispatch_queue_t json_request_operation_processing_queue() {
|
||||||
return requestOperation;
|
return requestOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[_responseJSON release];
|
|
||||||
[_JSONError release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)responseJSON {
|
- (id)responseJSON {
|
||||||
if (!_responseJSON && [self.responseData length] > 0 && [self isFinished] && !self.JSONError) {
|
if (!_responseJSON && [self.responseData length] > 0 && [self isFinished] && !self.JSONError) {
|
||||||
|
|
@ -101,31 +96,32 @@ static dispatch_queue_t json_request_operation_processing_queue() {
|
||||||
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
||||||
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
||||||
{
|
{
|
||||||
|
__weak AFJSONRequestOperation *weakSelf = self;
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if ([self isCancelled]) {
|
if ([weakSelf isCancelled]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.error) {
|
if (weakSelf.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatch_async(json_request_operation_processing_queue(), ^{
|
dispatch_async(json_request_operation_processing_queue(), ^{
|
||||||
id JSON = self.responseJSON;
|
id JSON = weakSelf.responseJSON;
|
||||||
|
|
||||||
if (self.JSONError) {
|
if (self.JSONError) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (success) {
|
if (success) {
|
||||||
dispatch_async(self.successCallbackQueue ? self.successCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.successCallbackQueue ? weakSelf.successCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
success(self, JSON);
|
success(weakSelf, JSON);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25;
|
||||||
|
|
||||||
@interface AFNetworkActivityIndicatorManager ()
|
@interface AFNetworkActivityIndicatorManager ()
|
||||||
@property (readwrite, atomic, assign) NSInteger activityCount;
|
@property (readwrite, atomic, assign) NSInteger activityCount;
|
||||||
@property (readwrite, nonatomic, retain) NSTimer *activityIndicatorVisibilityTimer;
|
@property (readwrite, nonatomic) NSTimer *activityIndicatorVisibilityTimer;
|
||||||
@property (readonly, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
|
@property (readonly, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
|
||||||
|
|
||||||
- (void)updateNetworkActivityIndicatorVisibility;
|
- (void)updateNetworkActivityIndicatorVisibility;
|
||||||
|
|
@ -67,9 +67,7 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25;
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
|
||||||
[_activityIndicatorVisibilityTimer invalidate];
|
[_activityIndicatorVisibilityTimer invalidate];
|
||||||
[_activityIndicatorVisibilityTimer release]; _activityIndicatorVisibilityTimer = nil;
|
|
||||||
|
|
||||||
[super dealloc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateNetworkActivityIndicatorVisibilityDelayed {
|
- (void)updateNetworkActivityIndicatorVisibilityDelayed {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
/**
|
/**
|
||||||
An object deserialized from a plist constructed using the response data.
|
An object deserialized from a plist constructed using the response data.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) id responsePropertyList;
|
@property (readonly, nonatomic) id responsePropertyList;
|
||||||
|
|
||||||
///--------------------------------------
|
///--------------------------------------
|
||||||
/// @name Managing Property List Behavior
|
/// @name Managing Property List Behavior
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ static dispatch_queue_t property_list_request_operation_processing_queue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFPropertyListRequestOperation ()
|
@interface AFPropertyListRequestOperation ()
|
||||||
@property (readwrite, nonatomic, retain) id responsePropertyList;
|
@property (readwrite, nonatomic) id responsePropertyList;
|
||||||
@property (readwrite, nonatomic, assign) NSPropertyListFormat propertyListFormat;
|
@property (readwrite, nonatomic, assign) NSPropertyListFormat propertyListFormat;
|
||||||
@property (readwrite, nonatomic, retain) NSError *propertyListError;
|
@property (readwrite, nonatomic) NSError *propertyListError;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation AFPropertyListRequestOperation
|
@implementation AFPropertyListRequestOperation
|
||||||
|
|
@ -47,7 +47,7 @@ static dispatch_queue_t property_list_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id propertyList))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id propertyList))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id propertyList))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id propertyList))failure
|
||||||
{
|
{
|
||||||
AFPropertyListRequestOperation *requestOperation = [[[self alloc] initWithRequest:request] autorelease];
|
AFPropertyListRequestOperation *requestOperation = [[self alloc] initWithRequest:request];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
success(operation.request, operation.response, responseObject);
|
success(operation.request, operation.response, responseObject);
|
||||||
|
|
@ -72,11 +72,6 @@ static dispatch_queue_t property_list_request_operation_processing_queue() {
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[_responsePropertyList release];
|
|
||||||
[_propertyListError release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)responsePropertyList {
|
- (id)responsePropertyList {
|
||||||
if (!_responsePropertyList && [self.responseData length] > 0 && [self isFinished]) {
|
if (!_responsePropertyList && [self.responseData length] > 0 && [self isFinished]) {
|
||||||
|
|
@ -111,31 +106,32 @@ static dispatch_queue_t property_list_request_operation_processing_queue() {
|
||||||
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
||||||
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
||||||
{
|
{
|
||||||
|
__weak AFPropertyListRequestOperation *weakSelf = self;
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if ([self isCancelled]) {
|
if ([weakSelf isCancelled]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.error) {
|
if (weakSelf.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatch_async(property_list_request_operation_processing_queue(), ^(void) {
|
dispatch_async(property_list_request_operation_processing_queue(), ^(void) {
|
||||||
id propertyList = self.responsePropertyList;
|
id propertyList = weakSelf.responsePropertyList;
|
||||||
|
|
||||||
if (self.propertyListError) {
|
if (self.propertyListError) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (success) {
|
if (success) {
|
||||||
dispatch_async(self.successCallbackQueue ? self.successCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.successCallbackQueue ? weakSelf.successCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
success(self, propertyList);
|
success(weakSelf, propertyList);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
|
||||||
/**
|
/**
|
||||||
The run loop modes in which the operation will run on the network thread. By default, this is a single-member set containing `NSRunLoopCommonModes`.
|
The run loop modes in which the operation will run on the network thread. By default, this is a single-member set containing `NSRunLoopCommonModes`.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, retain) NSSet *runLoopModes;
|
@property (nonatomic) NSSet *runLoopModes;
|
||||||
|
|
||||||
///-----------------------------------------
|
///-----------------------------------------
|
||||||
/// @name Getting URL Connection Information
|
/// @name Getting URL Connection Information
|
||||||
|
|
@ -93,17 +93,17 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
|
||||||
/**
|
/**
|
||||||
The request used by the operation's connection.
|
The request used by the operation's connection.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSURLRequest *request;
|
@property (readonly, nonatomic, strong) NSURLRequest *request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The last response received by the operation's connection.
|
The last response received by the operation's connection.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSURLResponse *response;
|
@property (readonly, nonatomic, strong) NSURLResponse *response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The error, if any, that occured in the lifecycle of the request.
|
The error, if any, that occured in the lifecycle of the request.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSError *error;
|
@property (readonly, nonatomic, strong) NSError *error;
|
||||||
|
|
||||||
///----------------------------
|
///----------------------------
|
||||||
/// @name Getting Response Data
|
/// @name Getting Response Data
|
||||||
|
|
@ -112,7 +112,7 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
|
||||||
/**
|
/**
|
||||||
The data received during the request.
|
The data received during the request.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSData *responseData;
|
@property (readonly, nonatomic, strong) NSData *responseData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The string representation of the response data.
|
The string representation of the response data.
|
||||||
|
|
@ -130,14 +130,14 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
|
||||||
|
|
||||||
@discussion This property acts as a proxy to the `HTTPBodyStream` property of `request`.
|
@discussion This property acts as a proxy to the `HTTPBodyStream` property of `request`.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, retain) NSInputStream *inputStream;
|
@property (nonatomic) NSInputStream *inputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The output stream that is used to write data received until the request is finished.
|
The output stream that is used to write data received until the request is finished.
|
||||||
|
|
||||||
@discussion By default, data is accumulated into a buffer that is stored into `responseData` upon completion of the request. When `outputStream` is set, the data will not be accumulated into an internal buffer, and as a result, the `responseData` property of the completed request will be `nil`. The output stream will be scheduled in the network thread runloop upon being set.
|
@discussion By default, data is accumulated into a buffer that is stored into `responseData` upon completion of the request. When `outputStream` is set, the data will not be accumulated into an internal buffer, and as a result, the `responseData` property of the completed request will be `nil`. The output stream will be scheduled in the network thread runloop upon being set.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, retain) NSOutputStream *outputStream;
|
@property (nonatomic) NSOutputStream *outputStream;
|
||||||
|
|
||||||
///------------------------------------------------------
|
///------------------------------------------------------
|
||||||
/// @name Initializing an AFURLConnectionOperation Object
|
/// @name Initializing an AFURLConnectionOperation Object
|
||||||
|
|
|
||||||
|
|
@ -103,12 +103,12 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
@interface AFURLConnectionOperation ()
|
@interface AFURLConnectionOperation ()
|
||||||
@property (readwrite, nonatomic, assign) AFOperationState state;
|
@property (readwrite, nonatomic, assign) AFOperationState state;
|
||||||
@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled;
|
@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled;
|
||||||
@property (readwrite, nonatomic, retain) NSRecursiveLock *lock;
|
@property (readwrite, nonatomic, strong) NSRecursiveLock *lock;
|
||||||
@property (readwrite, nonatomic, retain) NSURLConnection *connection;
|
@property (readwrite, nonatomic, strong) NSURLConnection *connection;
|
||||||
@property (readwrite, nonatomic, retain) NSURLRequest *request;
|
@property (readwrite, nonatomic, strong) NSURLRequest *request;
|
||||||
@property (readwrite, nonatomic, retain) NSURLResponse *response;
|
@property (readwrite, nonatomic, strong) NSURLResponse *response;
|
||||||
@property (readwrite, nonatomic, retain) NSError *error;
|
@property (readwrite, nonatomic, strong) NSError *error;
|
||||||
@property (readwrite, nonatomic, retain) NSData *responseData;
|
@property (readwrite, nonatomic, strong) NSData *responseData;
|
||||||
@property (readwrite, nonatomic, copy) NSString *responseString;
|
@property (readwrite, nonatomic, copy) NSString *responseString;
|
||||||
@property (readwrite, nonatomic, assign) long long totalBytesRead;
|
@property (readwrite, nonatomic, assign) long long totalBytesRead;
|
||||||
@property (readwrite, nonatomic, assign) AFBackgroundTaskIdentifier backgroundTaskIdentifier;
|
@property (readwrite, nonatomic, assign) AFBackgroundTaskIdentifier backgroundTaskIdentifier;
|
||||||
|
|
@ -147,9 +147,9 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
|
|
||||||
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
|
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
|
||||||
do {
|
do {
|
||||||
NSAutoreleasePool *runLoopPool = [[NSAutoreleasePool alloc] init];
|
@autoreleasepool {
|
||||||
[[NSRunLoop currentRunLoop] run];
|
[[NSRunLoop currentRunLoop] run];
|
||||||
[runLoopPool drain];
|
}
|
||||||
} while (YES);
|
} while (YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.lock = [[[NSRecursiveLock alloc] init] autorelease];
|
self.lock = [[NSRecursiveLock alloc] init];
|
||||||
self.lock.name = kAFNetworkingLockName;
|
self.lock.name = kAFNetworkingLockName;
|
||||||
|
|
||||||
self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
|
self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
|
||||||
|
|
@ -186,20 +186,12 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[_lock release];
|
|
||||||
|
|
||||||
[_runLoopModes release];
|
|
||||||
|
|
||||||
[_request release];
|
|
||||||
[_response release];
|
|
||||||
[_error release];
|
|
||||||
|
|
||||||
[_responseData release];
|
|
||||||
[_responseString release];
|
|
||||||
|
|
||||||
if (_outputStream) {
|
if (_outputStream) {
|
||||||
[_outputStream close];
|
[_outputStream close];
|
||||||
[_outputStream release];
|
|
||||||
_outputStream = nil;
|
_outputStream = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,16 +202,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[_uploadProgress release];
|
|
||||||
[_downloadProgress release];
|
|
||||||
[_authenticationChallenge release];
|
|
||||||
[_authenticationAgainstProtectionSpace release];
|
|
||||||
[_cacheResponse release];
|
|
||||||
[_redirectResponse release];
|
|
||||||
|
|
||||||
[_connection release];
|
|
||||||
|
|
||||||
[super dealloc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
|
|
@ -231,7 +215,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
if (!block) {
|
if (!block) {
|
||||||
[super setCompletionBlock:nil];
|
[super setCompletionBlock:nil];
|
||||||
} else {
|
} else {
|
||||||
__block id _blockSelf = self;
|
__unsafe_unretained id _blockSelf = self;
|
||||||
[super setCompletionBlock:^ {
|
[super setCompletionBlock:^ {
|
||||||
block();
|
block();
|
||||||
[_blockSelf setCompletionBlock:nil];
|
[_blockSelf setCompletionBlock:nil];
|
||||||
|
|
@ -246,7 +230,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
|
|
||||||
- (void)setInputStream:(NSInputStream *)inputStream {
|
- (void)setInputStream:(NSInputStream *)inputStream {
|
||||||
[self willChangeValueForKey:@"inputStream"];
|
[self willChangeValueForKey:@"inputStream"];
|
||||||
NSMutableURLRequest *mutableRequest = [[self.request mutableCopy] autorelease];
|
NSMutableURLRequest *mutableRequest = [self.request mutableCopy];
|
||||||
mutableRequest.HTTPBodyStream = inputStream;
|
mutableRequest.HTTPBodyStream = inputStream;
|
||||||
self.request = mutableRequest;
|
self.request = mutableRequest;
|
||||||
[self didChangeValueForKey:@"inputStream"];
|
[self didChangeValueForKey:@"inputStream"];
|
||||||
|
|
@ -254,11 +238,9 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
|
|
||||||
- (void)setOutputStream:(NSOutputStream *)outputStream {
|
- (void)setOutputStream:(NSOutputStream *)outputStream {
|
||||||
[self willChangeValueForKey:@"outputStream"];
|
[self willChangeValueForKey:@"outputStream"];
|
||||||
[outputStream retain];
|
|
||||||
|
|
||||||
if (_outputStream) {
|
if (_outputStream) {
|
||||||
[_outputStream close];
|
[_outputStream close];
|
||||||
[_outputStream release];
|
|
||||||
}
|
}
|
||||||
_outputStream = outputStream;
|
_outputStream = outputStream;
|
||||||
[self didChangeValueForKey:@"outputStream"];
|
[self didChangeValueForKey:@"outputStream"];
|
||||||
|
|
@ -344,10 +326,10 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
if (!_responseString && self.response && self.responseData) {
|
if (!_responseString && self.response && self.responseData) {
|
||||||
NSStringEncoding textEncoding = NSUTF8StringEncoding;
|
NSStringEncoding textEncoding = NSUTF8StringEncoding;
|
||||||
if (self.response.textEncodingName) {
|
if (self.response.textEncodingName) {
|
||||||
textEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)self.response.textEncodingName));
|
textEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)self.response.textEncodingName));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.responseString = [[[NSString alloc] initWithData:self.responseData encoding:textEncoding] autorelease];
|
self.responseString = [[NSString alloc] initWithData:self.responseData encoding:textEncoding];
|
||||||
}
|
}
|
||||||
[self.lock unlock];
|
[self.lock unlock];
|
||||||
|
|
||||||
|
|
@ -416,7 +398,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
if ([self isCancelled]) {
|
if ([self isCancelled]) {
|
||||||
[self finish];
|
[self finish];
|
||||||
} else {
|
} else {
|
||||||
self.connection = [[[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO] autorelease];
|
self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO];
|
||||||
|
|
||||||
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
|
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
|
||||||
for (NSString *runLoopMode in self.runLoopModes) {
|
for (NSString *runLoopMode in self.runLoopModes) {
|
||||||
|
|
@ -496,8 +478,8 @@ didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||||
if ([challenge previousFailureCount] == 0) {
|
if ([challenge previousFailureCount] == 0) {
|
||||||
NSURLCredential *credential = nil;
|
NSURLCredential *credential = nil;
|
||||||
|
|
||||||
NSString *username = [(NSString *)CFURLCopyUserName((CFURLRef)[self.request URL]) autorelease];
|
NSString *username = (__bridge_transfer NSString *)CFURLCopyUserName((__bridge CFURLRef)[self.request URL]);
|
||||||
NSString *password = [(NSString *)CFURLCopyPassword((CFURLRef)[self.request URL]) autorelease];
|
NSString *password = (__bridge_transfer NSString *)CFURLCopyPassword((__bridge CFURLRef)[self.request URL]);
|
||||||
|
|
||||||
if (username && password) {
|
if (username && password) {
|
||||||
credential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
|
credential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
/**
|
/**
|
||||||
An `NSXMLParser` object constructed from the response data.
|
An `NSXMLParser` object constructed from the response data.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, retain) NSXMLParser *responseXMLParser;
|
@property (readonly, nonatomic) NSXMLParser *responseXMLParser;
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,11 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFXMLRequestOperation ()
|
@interface AFXMLRequestOperation ()
|
||||||
@property (readwrite, nonatomic, retain) NSXMLParser *responseXMLParser;
|
@property (readwrite, nonatomic) NSXMLParser *responseXMLParser;
|
||||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
@property (readwrite, nonatomic, retain) NSXMLDocument *responseXMLDocument;
|
@property (readwrite, nonatomic, retain) NSXMLDocument *responseXMLDocument;
|
||||||
#endif
|
#endif
|
||||||
@property (readwrite, nonatomic, retain) NSError *XMLError;
|
@property (readwrite, nonatomic) NSError *XMLError;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation AFXMLRequestOperation
|
@implementation AFXMLRequestOperation
|
||||||
|
|
@ -52,7 +52,7 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSXMLParser *XMLParser))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSXMLParser *XMLParser))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSXMLParser *XMLParser))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSXMLParser *XMLParser))failure
|
||||||
{
|
{
|
||||||
AFXMLRequestOperation *requestOperation = [[[self alloc] initWithRequest:urlRequest] autorelease];
|
AFXMLRequestOperation *requestOperation = [[self alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
success(operation.request, operation.response, responseObject);
|
success(operation.request, operation.response, responseObject);
|
||||||
|
|
@ -71,7 +71,7 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSXMLDocument *document))success
|
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSXMLDocument *document))success
|
||||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSXMLDocument *document))failure
|
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSXMLDocument *document))failure
|
||||||
{
|
{
|
||||||
AFXMLRequestOperation *requestOperation = [[[self alloc] initWithRequest:urlRequest] autorelease];
|
AFXMLRequestOperation *requestOperation = [[self alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, __unused id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, __unused id responseObject) {
|
||||||
if (success) {
|
if (success) {
|
||||||
NSXMLDocument *XMLDocument = [(AFXMLRequestOperation *)operation responseXMLDocument];
|
NSXMLDocument *XMLDocument = [(AFXMLRequestOperation *)operation responseXMLDocument];
|
||||||
|
|
@ -88,21 +88,10 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[_responseXMLParser release];
|
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
|
||||||
[_responseXMLDocument release];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[_XMLError release];
|
|
||||||
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSXMLParser *)responseXMLParser {
|
- (NSXMLParser *)responseXMLParser {
|
||||||
if (!_responseXMLParser && [self.responseData length] > 0 && [self isFinished]) {
|
if (!_responseXMLParser && [self.responseData length] > 0 && [self isFinished]) {
|
||||||
self.responseXMLParser = [[[NSXMLParser alloc] initWithData:self.responseData] autorelease];
|
self.responseXMLParser = [[NSXMLParser alloc] initWithData:self.responseData];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _responseXMLParser;
|
return _responseXMLParser;
|
||||||
|
|
@ -112,7 +101,7 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
- (NSXMLDocument *)responseXMLDocument {
|
- (NSXMLDocument *)responseXMLDocument {
|
||||||
if (!_responseXMLDocument && [self.responseData length] > 0 && [self isFinished]) {
|
if (!_responseXMLDocument && [self.responseData length] > 0 && [self isFinished]) {
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
self.responseXMLDocument = [[[NSXMLDocument alloc] initWithData:self.responseData options:0 error:&error] autorelease];
|
self.responseXMLDocument = [[NSXMLDocument alloc] initWithData:self.responseData options:0 error:&error];
|
||||||
self.XMLError = error;
|
self.XMLError = error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,24 +138,25 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
|
||||||
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
|
||||||
{
|
{
|
||||||
|
__weak AFXMLRequestOperation *weakSelf = self;
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if ([self isCancelled]) {
|
if ([weakSelf isCancelled]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_async(xml_request_operation_processing_queue(), ^(void) {
|
dispatch_async(xml_request_operation_processing_queue(), ^(void) {
|
||||||
NSXMLParser *XMLParser = self.responseXMLParser;
|
NSXMLParser *XMLParser = weakSelf.responseXMLParser;
|
||||||
|
|
||||||
if (self.error) {
|
if (self.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
dispatch_async(self.failureCallbackQueue ? self.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.failureCallbackQueue ? weakSelf.failureCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
failure(self, self.error);
|
failure(weakSelf, weakSelf.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (success) {
|
if (success) {
|
||||||
dispatch_async(self.successCallbackQueue ? self.successCallbackQueue : dispatch_get_main_queue(), ^{
|
dispatch_async(weakSelf.successCallbackQueue ? weakSelf.successCallbackQueue : dispatch_get_main_queue(), ^{
|
||||||
success(self, XMLParser);
|
success(weakSelf, XMLParser);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ static char kAFImageRequestOperationObjectKey;
|
||||||
} else {
|
} else {
|
||||||
self.image = placeholderImage;
|
self.image = placeholderImage;
|
||||||
|
|
||||||
AFImageRequestOperation *requestOperation = [[[AFImageRequestOperation alloc] initWithRequest:urlRequest] autorelease];
|
AFImageRequestOperation *requestOperation = [[AFImageRequestOperation alloc] initWithRequest:urlRequest];
|
||||||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||||
if ([[urlRequest URL] isEqual:[[self.af_imageRequestOperation request] URL]]) {
|
if ([[urlRequest URL] isEqual:[[self.af_imageRequestOperation request] URL]]) {
|
||||||
self.image = responseObject;
|
self.image = responseObject;
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,16 @@
|
||||||
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C251591073C009BFE23 /* AFTwitterAPIClient.m */; };
|
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C251591073C009BFE23 /* AFTwitterAPIClient.m */; };
|
||||||
F8129C341591073C009BFE23 /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2B1591073C009BFE23 /* Tweet.m */; };
|
F8129C341591073C009BFE23 /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2B1591073C009BFE23 /* Tweet.m */; };
|
||||||
F8129C351591073C009BFE23 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2D1591073C009BFE23 /* User.m */; };
|
F8129C351591073C009BFE23 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2D1591073C009BFE23 /* User.m */; };
|
||||||
F8129C631591090B009BFE23 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C4F1591090B009BFE23 /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C641591090B009BFE23 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C651591090B009BFE23 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C531591090B009BFE23 /* AFImageRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C661591090B009BFE23 /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C681591090B009BFE23 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C691591090B009BFE23 /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C6A1591090B009BFE23 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C6B1591090B009BFE23 /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C6C1591090B009BFE23 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
|
||||||
F8129C6F15910B15009BFE23 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C6E15910B15009BFE23 /* main.m */; };
|
F8129C6F15910B15009BFE23 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C6E15910B15009BFE23 /* main.m */; };
|
||||||
F8129C7115910B3E009BFE23 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8129C7015910B3E009BFE23 /* MainMenu.xib */; };
|
F8129C7115910B3E009BFE23 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8129C7015910B3E009BFE23 /* MainMenu.xib */; };
|
||||||
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C7515910C40009BFE23 /* AppDelegate.m */; };
|
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C7515910C40009BFE23 /* AppDelegate.m */; };
|
||||||
|
F82EB07C159A172000B10B56 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB06E159A172000B10B56 /* AFHTTPClient.m */; };
|
||||||
|
F82EB07D159A172000B10B56 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB070159A172000B10B56 /* AFHTTPRequestOperation.m */; };
|
||||||
|
F82EB07E159A172000B10B56 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB072159A172000B10B56 /* AFImageRequestOperation.m */; };
|
||||||
|
F82EB07F159A172000B10B56 /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB074159A172000B10B56 /* AFJSONRequestOperation.m */; };
|
||||||
|
F82EB080159A172000B10B56 /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB077159A172000B10B56 /* AFPropertyListRequestOperation.m */; };
|
||||||
|
F82EB081159A172000B10B56 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB079159A172000B10B56 /* AFURLConnectionOperation.m */; };
|
||||||
|
F82EB082159A172000B10B56 /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F82EB07B159A172000B10B56 /* AFXMLRequestOperation.m */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
|
@ -37,29 +35,25 @@
|
||||||
F8129C2C1591073C009BFE23 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
|
F8129C2C1591073C009BFE23 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
|
||||||
F8129C2D1591073C009BFE23 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
|
F8129C2D1591073C009BFE23 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
|
||||||
F8129C311591073C009BFE23 /* AFTwitterAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFTwitterAPIClient.h; path = Classes/AFTwitterAPIClient.h; sourceTree = SOURCE_ROOT; };
|
F8129C311591073C009BFE23 /* AFTwitterAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFTwitterAPIClient.h; path = Classes/AFTwitterAPIClient.h; sourceTree = SOURCE_ROOT; };
|
||||||
F8129C4E1591090B009BFE23 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPClient.h; path = ../AFNetworking/AFHTTPClient.h; sourceTree = "<group>"; };
|
|
||||||
F8129C4F1591090B009BFE23 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPClient.m; path = ../AFNetworking/AFHTTPClient.m; sourceTree = "<group>"; };
|
|
||||||
F8129C501591090B009BFE23 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = ../AFNetworking/AFHTTPRequestOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = ../AFNetworking/AFHTTPRequestOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C521591090B009BFE23 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequestOperation.h; path = ../AFNetworking/AFImageRequestOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C531591090B009BFE23 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequestOperation.m; path = ../AFNetworking/AFImageRequestOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C541591090B009BFE23 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFJSONRequestOperation.h; path = ../AFNetworking/AFJSONRequestOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFJSONRequestOperation.m; path = ../AFNetworking/AFJSONRequestOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C581591090B009BFE23 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = ../AFNetworking/AFNetworkActivityIndicatorManager.h; sourceTree = "<group>"; };
|
|
||||||
F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = ../AFNetworking/AFNetworkActivityIndicatorManager.m; sourceTree = "<group>"; };
|
|
||||||
F8129C5A1591090B009BFE23 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = ../AFNetworking/AFNetworking.h; sourceTree = "<group>"; };
|
|
||||||
F8129C5B1591090B009BFE23 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFPropertyListRequestOperation.h; path = ../AFNetworking/AFPropertyListRequestOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFPropertyListRequestOperation.m; path = ../AFNetworking/AFPropertyListRequestOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C5D1591090B009BFE23 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = ../AFNetworking/AFURLConnectionOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = ../AFNetworking/AFURLConnectionOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C5F1591090B009BFE23 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFXMLRequestOperation.h; path = ../AFNetworking/AFXMLRequestOperation.h; sourceTree = "<group>"; };
|
|
||||||
F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFXMLRequestOperation.m; path = ../AFNetworking/AFXMLRequestOperation.m; sourceTree = "<group>"; };
|
|
||||||
F8129C611591090B009BFE23 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "../AFNetworking/UIImageView+AFNetworking.h"; sourceTree = "<group>"; };
|
|
||||||
F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "../AFNetworking/UIImageView+AFNetworking.m"; sourceTree = "<group>"; };
|
|
||||||
F8129C6E15910B15009BFE23 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
|
F8129C6E15910B15009BFE23 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
|
||||||
F8129C7015910B3E009BFE23 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = SOURCE_ROOT; };
|
F8129C7015910B3E009BFE23 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = SOURCE_ROOT; };
|
||||||
F8129C7515910C40009BFE23 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
F8129C7515910C40009BFE23 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||||
F8129C7615910C40009BFE23 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
F8129C7615910C40009BFE23 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||||
|
F82EB06D159A172000B10B56 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPClient.h; path = ../AFNetworking/AFHTTPClient.h; sourceTree = "<group>"; };
|
||||||
|
F82EB06E159A172000B10B56 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPClient.m; path = ../AFNetworking/AFHTTPClient.m; sourceTree = "<group>"; };
|
||||||
|
F82EB06F159A172000B10B56 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = ../AFNetworking/AFHTTPRequestOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB070159A172000B10B56 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = ../AFNetworking/AFHTTPRequestOperation.m; sourceTree = "<group>"; };
|
||||||
|
F82EB071159A172000B10B56 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequestOperation.h; path = ../AFNetworking/AFImageRequestOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB072159A172000B10B56 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequestOperation.m; path = ../AFNetworking/AFImageRequestOperation.m; sourceTree = "<group>"; };
|
||||||
|
F82EB073159A172000B10B56 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFJSONRequestOperation.h; path = ../AFNetworking/AFJSONRequestOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB074159A172000B10B56 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFJSONRequestOperation.m; path = ../AFNetworking/AFJSONRequestOperation.m; sourceTree = "<group>"; };
|
||||||
|
F82EB075159A172000B10B56 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = ../AFNetworking/AFNetworking.h; sourceTree = "<group>"; };
|
||||||
|
F82EB076159A172000B10B56 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFPropertyListRequestOperation.h; path = ../AFNetworking/AFPropertyListRequestOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB077159A172000B10B56 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFPropertyListRequestOperation.m; path = ../AFNetworking/AFPropertyListRequestOperation.m; sourceTree = "<group>"; };
|
||||||
|
F82EB078159A172000B10B56 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = ../AFNetworking/AFURLConnectionOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB079159A172000B10B56 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = ../AFNetworking/AFURLConnectionOperation.m; sourceTree = "<group>"; };
|
||||||
|
F82EB07A159A172000B10B56 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFXMLRequestOperation.h; path = ../AFNetworking/AFXMLRequestOperation.h; sourceTree = "<group>"; };
|
||||||
|
F82EB07B159A172000B10B56 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFXMLRequestOperation.m; path = ../AFNetworking/AFXMLRequestOperation.m; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
|
@ -149,29 +143,33 @@
|
||||||
F8129C4C15910901009BFE23 /* Vendor */ = {
|
F8129C4C15910901009BFE23 /* Vendor */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
F8129C4E1591090B009BFE23 /* AFHTTPClient.h */,
|
F82EB083159A172500B10B56 /* AFNetworking */,
|
||||||
F8129C4F1591090B009BFE23 /* AFHTTPClient.m */,
|
|
||||||
F8129C501591090B009BFE23 /* AFHTTPRequestOperation.h */,
|
|
||||||
F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */,
|
|
||||||
F8129C521591090B009BFE23 /* AFImageRequestOperation.h */,
|
|
||||||
F8129C531591090B009BFE23 /* AFImageRequestOperation.m */,
|
|
||||||
F8129C541591090B009BFE23 /* AFJSONRequestOperation.h */,
|
|
||||||
F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */,
|
|
||||||
F8129C581591090B009BFE23 /* AFNetworkActivityIndicatorManager.h */,
|
|
||||||
F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */,
|
|
||||||
F8129C5A1591090B009BFE23 /* AFNetworking.h */,
|
|
||||||
F8129C5B1591090B009BFE23 /* AFPropertyListRequestOperation.h */,
|
|
||||||
F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */,
|
|
||||||
F8129C5D1591090B009BFE23 /* AFURLConnectionOperation.h */,
|
|
||||||
F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */,
|
|
||||||
F8129C5F1591090B009BFE23 /* AFXMLRequestOperation.h */,
|
|
||||||
F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */,
|
|
||||||
F8129C611591090B009BFE23 /* UIImageView+AFNetworking.h */,
|
|
||||||
F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */,
|
|
||||||
);
|
);
|
||||||
name = Vendor;
|
name = Vendor;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
F82EB083159A172500B10B56 /* AFNetworking */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F82EB06D159A172000B10B56 /* AFHTTPClient.h */,
|
||||||
|
F82EB06E159A172000B10B56 /* AFHTTPClient.m */,
|
||||||
|
F82EB06F159A172000B10B56 /* AFHTTPRequestOperation.h */,
|
||||||
|
F82EB070159A172000B10B56 /* AFHTTPRequestOperation.m */,
|
||||||
|
F82EB071159A172000B10B56 /* AFImageRequestOperation.h */,
|
||||||
|
F82EB072159A172000B10B56 /* AFImageRequestOperation.m */,
|
||||||
|
F82EB073159A172000B10B56 /* AFJSONRequestOperation.h */,
|
||||||
|
F82EB074159A172000B10B56 /* AFJSONRequestOperation.m */,
|
||||||
|
F82EB075159A172000B10B56 /* AFNetworking.h */,
|
||||||
|
F82EB076159A172000B10B56 /* AFPropertyListRequestOperation.h */,
|
||||||
|
F82EB077159A172000B10B56 /* AFPropertyListRequestOperation.m */,
|
||||||
|
F82EB078159A172000B10B56 /* AFURLConnectionOperation.h */,
|
||||||
|
F82EB079159A172000B10B56 /* AFURLConnectionOperation.m */,
|
||||||
|
F82EB07A159A172000B10B56 /* AFXMLRequestOperation.h */,
|
||||||
|
F82EB07B159A172000B10B56 /* AFXMLRequestOperation.m */,
|
||||||
|
);
|
||||||
|
name = AFNetworking;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
|
|
@ -236,17 +234,15 @@
|
||||||
F8129C341591073C009BFE23 /* Tweet.m in Sources */,
|
F8129C341591073C009BFE23 /* Tweet.m in Sources */,
|
||||||
F8129C351591073C009BFE23 /* User.m in Sources */,
|
F8129C351591073C009BFE23 /* User.m in Sources */,
|
||||||
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */,
|
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */,
|
||||||
F8129C631591090B009BFE23 /* AFHTTPClient.m in Sources */,
|
|
||||||
F8129C641591090B009BFE23 /* AFHTTPRequestOperation.m in Sources */,
|
|
||||||
F8129C651591090B009BFE23 /* AFImageRequestOperation.m in Sources */,
|
|
||||||
F8129C661591090B009BFE23 /* AFJSONRequestOperation.m in Sources */,
|
|
||||||
F8129C681591090B009BFE23 /* AFNetworkActivityIndicatorManager.m in Sources */,
|
|
||||||
F8129C691591090B009BFE23 /* AFPropertyListRequestOperation.m in Sources */,
|
|
||||||
F8129C6A1591090B009BFE23 /* AFURLConnectionOperation.m in Sources */,
|
|
||||||
F8129C6B1591090B009BFE23 /* AFXMLRequestOperation.m in Sources */,
|
|
||||||
F8129C6C1591090B009BFE23 /* UIImageView+AFNetworking.m in Sources */,
|
|
||||||
F8129C6F15910B15009BFE23 /* main.m in Sources */,
|
F8129C6F15910B15009BFE23 /* main.m in Sources */,
|
||||||
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */,
|
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */,
|
||||||
|
F82EB07C159A172000B10B56 /* AFHTTPClient.m in Sources */,
|
||||||
|
F82EB07D159A172000B10B56 /* AFHTTPRequestOperation.m in Sources */,
|
||||||
|
F82EB07E159A172000B10B56 /* AFImageRequestOperation.m in Sources */,
|
||||||
|
F82EB07F159A172000B10B56 /* AFJSONRequestOperation.m in Sources */,
|
||||||
|
F82EB080159A172000B10B56 /* AFPropertyListRequestOperation.m in Sources */,
|
||||||
|
F82EB081159A172000B10B56 /* AFURLConnectionOperation.m in Sources */,
|
||||||
|
F82EB082159A172000B10B56 /* AFXMLRequestOperation.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,15 @@
|
||||||
F8FA9494150EF97E00ED4EAD /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9493150EF97E00ED4EAD /* Tweet.m */; };
|
F8FA9494150EF97E00ED4EAD /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9493150EF97E00ED4EAD /* Tweet.m */; };
|
||||||
F8FA9497150EF98800ED4EAD /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9496150EF98800ED4EAD /* User.m */; };
|
F8FA9497150EF98800ED4EAD /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9496150EF98800ED4EAD /* User.m */; };
|
||||||
F8FA949A150EF9DA00ED4EAD /* PublicTimelineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9499150EF9DA00ED4EAD /* PublicTimelineViewController.m */; };
|
F8FA949A150EF9DA00ED4EAD /* PublicTimelineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA9499150EF9DA00ED4EAD /* PublicTimelineViewController.m */; };
|
||||||
F8FA94B1150EFEC100ED4EAD /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA949D150EFEC100ED4EAD /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B1150EFEC100ED4EAD /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA949D150EFEC100ED4EAD /* AFHTTPClient.m */; };
|
||||||
F8FA94B2150EFEC100ED4EAD /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA949F150EFEC100ED4EAD /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B2150EFEC100ED4EAD /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA949F150EFEC100ED4EAD /* AFHTTPRequestOperation.m */; };
|
||||||
F8FA94B3150EFEC100ED4EAD /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A1150EFEC100ED4EAD /* AFImageRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B3150EFEC100ED4EAD /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A1150EFEC100ED4EAD /* AFImageRequestOperation.m */; };
|
||||||
F8FA94B4150EFEC100ED4EAD /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A3150EFEC100ED4EAD /* AFJSONRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B4150EFEC100ED4EAD /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A3150EFEC100ED4EAD /* AFJSONRequestOperation.m */; };
|
||||||
F8FA94B6150EFEC100ED4EAD /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A7150EFEC100ED4EAD /* AFNetworkActivityIndicatorManager.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B6150EFEC100ED4EAD /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94A7150EFEC100ED4EAD /* AFNetworkActivityIndicatorManager.m */; };
|
||||||
F8FA94B7150EFEC100ED4EAD /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AA150EFEC100ED4EAD /* AFPropertyListRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B7150EFEC100ED4EAD /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AA150EFEC100ED4EAD /* AFPropertyListRequestOperation.m */; };
|
||||||
F8FA94B8150EFEC100ED4EAD /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AC150EFEC100ED4EAD /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B8150EFEC100ED4EAD /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AC150EFEC100ED4EAD /* AFURLConnectionOperation.m */; };
|
||||||
F8FA94B9150EFEC100ED4EAD /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AE150EFEC100ED4EAD /* AFXMLRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94B9150EFEC100ED4EAD /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94AE150EFEC100ED4EAD /* AFXMLRequestOperation.m */; };
|
||||||
F8FA94BA150EFEC100ED4EAD /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94B0150EFEC100ED4EAD /* UIImageView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
F8FA94BA150EFEC100ED4EAD /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94B0150EFEC100ED4EAD /* UIImageView+AFNetworking.m */; };
|
||||||
F8FA94C1150F019100ED4EAD /* TweetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94C0150F019100ED4EAD /* TweetTableViewCell.m */; };
|
F8FA94C1150F019100ED4EAD /* TweetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FA94C0150F019100ED4EAD /* TweetTableViewCell.m */; };
|
||||||
F8FA94D0150F094D00ED4EAD /* profile-image-placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = F8FA94CC150F094D00ED4EAD /* profile-image-placeholder.png */; };
|
F8FA94D0150F094D00ED4EAD /* profile-image-placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = F8FA94CC150F094D00ED4EAD /* profile-image-placeholder.png */; };
|
||||||
F8FA94D1150F094D00ED4EAD /* profile-image-placeholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F8FA94CD150F094D00ED4EAD /* profile-image-placeholder@2x.png */; };
|
F8FA94D1150F094D00ED4EAD /* profile-image-placeholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F8FA94CD150F094D00ED4EAD /* profile-image-placeholder@2x.png */; };
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||||
|
|
||||||
@property (strong) IBOutlet NSWindow *window;
|
@property (strong) IBOutlet NSWindow *window;
|
||||||
@property (weak) IBOutlet NSTableView *tableView;
|
@property (strong) IBOutlet NSTableView *tableView;
|
||||||
@property (strong) IBOutlet NSArrayController *tweetsArrayController;
|
@property (strong) IBOutlet NSArrayController *tweetsArrayController;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
@interface Tweet : NSObject
|
@interface Tweet : NSObject
|
||||||
|
|
||||||
@property (readonly) NSUInteger tweetID;
|
@property (readonly, assign) NSUInteger tweetID;
|
||||||
@property (readonly) NSString *text;
|
@property (readonly, strong) NSString *text;
|
||||||
|
|
||||||
@property (readonly) User *user;
|
@property (readonly, strong) User *user;
|
||||||
|
|
||||||
- (id)initWithAttributes:(NSDictionary *)attributes;
|
- (id)initWithAttributes:(NSDictionary *)attributes;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,7 @@
|
||||||
|
|
||||||
#import "AFTwitterAPIClient.h"
|
#import "AFTwitterAPIClient.h"
|
||||||
|
|
||||||
@implementation Tweet {
|
@implementation Tweet
|
||||||
@private
|
|
||||||
NSUInteger _tweetID;
|
|
||||||
__strong NSString *_text;
|
|
||||||
__strong User *_user;
|
|
||||||
}
|
|
||||||
|
|
||||||
@synthesize tweetID = _tweetID;
|
@synthesize tweetID = _tweetID;
|
||||||
@synthesize text = _text;
|
@synthesize text = _text;
|
||||||
@synthesize user = _user;
|
@synthesize user = _user;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ extern NSString * const kUserProfileImageDidLoadNotification;
|
||||||
@interface User : NSObject
|
@interface User : NSObject
|
||||||
|
|
||||||
@property (readonly) NSUInteger userID;
|
@property (readonly) NSUInteger userID;
|
||||||
@property (readonly) NSString *username;
|
@property (strong, readonly) NSString *username;
|
||||||
@property (unsafe_unretained, readonly) NSURL *profileImageURL;
|
@property (unsafe_unretained, readonly) NSURL *profileImageURL;
|
||||||
|
|
||||||
- (id)initWithAttributes:(NSDictionary *)attributes;
|
- (id)initWithAttributes:(NSDictionary *)attributes;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue