aCoder / aDecoder -> coder / decoder

This commit is contained in:
Mattt Thompson 2013-10-19 13:38:50 +02:00
parent 6f1a31ad29
commit 5b9d15781f
7 changed files with 100 additions and 100 deletions

View File

@ -166,21 +166,21 @@ static dispatch_group_t http_request_operation_completion_group() {
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.responseSerializer = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
self.responseSerializer = [decoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
[coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
}
#pragma mark - NSCopying

View File

@ -205,24 +205,24 @@
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
NSURL *baseURL = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];
- (id)initWithCoder:(NSCoder *)decoder {
NSURL *baseURL = [decoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];
self = [self initWithBaseURL:baseURL];
if (!self) {
return nil;
}
self.requestSerializer = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(requestSerializer))];
self.responseSerializer = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
self.requestSerializer = [decoder decodeObjectForKey:NSStringFromSelector(@selector(requestSerializer))];
self.responseSerializer = [decoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
[aCoder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
[aCoder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
[coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
[coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
}
#pragma mark - NSCopying

View File

@ -279,28 +279,28 @@
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
NSURL *baseURL = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];
NSURLSessionConfiguration *configuration = [aDecoder decodeObjectForKey:@"sessionConfiguration"];
- (id)initWithCoder:(NSCoder *)decoder {
NSURL *baseURL = [decoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];
NSURLSessionConfiguration *configuration = [decoder decodeObjectForKey:@"sessionConfiguration"];
self = [self initWithBaseURL:baseURL sessionConfiguration:configuration];
if (!self) {
return nil;
}
self.requestSerializer = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(requestSerializer))];
self.responseSerializer = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
self.requestSerializer = [decoder decodeObjectForKey:NSStringFromSelector(@selector(requestSerializer))];
self.responseSerializer = [decoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializer))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
[aCoder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
[aCoder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
[aCoder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
[coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
[coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
[coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
[coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
}
#pragma mark - NSCopying

View File

@ -666,44 +666,44 @@ didReceiveResponse:(NSURLResponse *)response
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
NSURLRequest *request = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(request))];
- (id)initWithCoder:(NSCoder *)decoder {
NSURLRequest *request = [decoder decodeObjectForKey:NSStringFromSelector(@selector(request))];
self = [self initWithRequest:request];
if (!self) {
return nil;
}
self.state = (AFOperationState)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(state))];
self.cancelled = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(isCancelled))];
self.response = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(response))];
self.error = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(error))];
self.responseData = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(responseData))];
self.totalBytesRead = [aDecoder decodeInt64ForKey:NSStringFromSelector(@selector(totalBytesRead))];
self.state = (AFOperationState)[decoder decodeIntegerForKey:NSStringFromSelector(@selector(state))];
self.cancelled = [decoder decodeBoolForKey:NSStringFromSelector(@selector(isCancelled))];
self.response = [decoder decodeObjectForKey:NSStringFromSelector(@selector(response))];
self.error = [decoder decodeObjectForKey:NSStringFromSelector(@selector(error))];
self.responseData = [decoder decodeObjectForKey:NSStringFromSelector(@selector(responseData))];
self.totalBytesRead = [decoder decodeInt64ForKey:NSStringFromSelector(@selector(totalBytesRead))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
- (void)encodeWithCoder:(NSCoder *)coder {
[self pause];
[aCoder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))];
[coder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))];
switch (self.state) {
case AFOperationExecutingState:
case AFOperationPausedState:
[aCoder encodeInteger:AFOperationReadyState forKey:NSStringFromSelector(@selector(state))];
[coder encodeInteger:AFOperationReadyState forKey:NSStringFromSelector(@selector(state))];
break;
default:
[aCoder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))];
[coder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))];
break;
}
[aCoder encodeBool:[self isCancelled] forKey:NSStringFromSelector(@selector(isCancelled))];
[aCoder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))];
[aCoder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))];
[aCoder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))];
[aCoder encodeInt64:self.totalBytesRead forKey:NSStringFromSelector(@selector(totalBytesRead))];
[coder encodeBool:[self isCancelled] forKey:NSStringFromSelector(@selector(isCancelled))];
[coder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))];
[coder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))];
[coder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))];
[coder encodeInt64:self.totalBytesRead forKey:NSStringFromSelector(@selector(totalBytesRead))];
}
#pragma mark - NSCopying

View File

@ -354,21 +354,21 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
- (id)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
self.mutableHTTPRequestHeaders = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
self.mutableHTTPRequestHeaders = [decoder decodeObjectForKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[decoder decodeIntegerForKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
[aCoder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
[coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
}
#pragma mark - NSCopying
@ -1103,23 +1103,23 @@ typedef enum {
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.format = (NSPropertyListFormat)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(format))];
self.writeOptions = [aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(writeOptions))];
self.format = (NSPropertyListFormat)[decoder decodeIntegerForKey:NSStringFromSelector(@selector(format))];
self.writeOptions = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(writeOptions))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
[aCoder encodeInteger:(NSInteger)self.writeOptions forKey:NSStringFromSelector(@selector(writeOptions))];
[coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
[coder encodeInteger:(NSInteger)self.writeOptions forKey:NSStringFromSelector(@selector(writeOptions))];
}
#pragma mark - NSCopying

View File

@ -102,21 +102,21 @@ extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
- (id)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
self.acceptableStatusCodes = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
self.acceptableContentTypes = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(acceptableContentTypes))];
self.acceptableStatusCodes = [decoder decodeObjectForKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
self.acceptableContentTypes = [decoder decodeObjectForKey:NSStringFromSelector(@selector(acceptableContentTypes))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
[aCoder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
[coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
}
#pragma mark - NSCopying
@ -206,21 +206,21 @@ extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.readingOptions = [aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(readingOptions))];
self.readingOptions = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(readingOptions))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeInteger:self.readingOptions forKey:NSStringFromSelector(@selector(readingOptions))];
[coder encodeInteger:self.readingOptions forKey:NSStringFromSelector(@selector(readingOptions))];
}
#pragma mark - NSCopying
@ -317,21 +317,21 @@ extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.options = [aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(options))];
self.options = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(options))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeInteger:self.options forKey:NSStringFromSelector(@selector(options))];
[coder encodeInteger:self.options forKey:NSStringFromSelector(@selector(options))];
}
#pragma mark - NSCopying
@ -403,23 +403,23 @@ extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.format = (NSPropertyListFormat)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(format))];
self.readOptions = [aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(readOptions))];
self.format = (NSPropertyListFormat)[decoder decodeIntegerForKey:NSStringFromSelector(@selector(format))];
self.readOptions = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(readOptions))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
[aCoder encodeInteger:(NSInteger)self.readOptions forKey:NSStringFromSelector(@selector(readOptions))];
[coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
[coder encodeInteger:(NSInteger)self.readOptions forKey:NSStringFromSelector(@selector(readOptions))];
}
#pragma mark - NSCopying
@ -585,26 +585,26 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
self.imageScale = [aDecoder decodeFloatForKey:NSStringFromSelector(@selector(imageScale))];
self.automaticallyInflatesResponseImage = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
self.imageScale = [decoder decodeFloatForKey:NSStringFromSelector(@selector(imageScale))];
self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
#endif
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
[aCoder encodeFloat:self.imageScale forKey:NSStringFromSelector(@selector(imageScale))];
[aCoder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
[coder encodeFloat:self.imageScale forKey:NSStringFromSelector(@selector(imageScale))];
[coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
#endif
}
@ -662,21 +662,21 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.responseSerializers = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializers))];
self.responseSerializers = [decoder decodeObjectForKey:NSStringFromSelector(@selector(responseSerializers))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[aCoder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))];
[coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))];
}
#pragma mark - NSCopying

View File

@ -875,8 +875,8 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
#pragma mark - NSCoding
- (id)initWithCoder:(NSCoder *)aDecoder {
NSURLSessionConfiguration *configuration = [aDecoder decodeObjectForKey:@"sessionConfiguration"];
- (id)initWithCoder:(NSCoder *)decoder {
NSURLSessionConfiguration *configuration = [decoder decodeObjectForKey:@"sessionConfiguration"];
self = [self initWithSessionConfiguration:configuration];
if (!self) {
@ -886,8 +886,8 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
}
#pragma mark - NSCopying