From 247863cfc2185f5cc6278ef1f5ba3ac685008f5f Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Fri, 9 Nov 2012 07:31:53 -0800 Subject: [PATCH] [Issue #633] Manually casting scalar types in initWithCoder for AFURLConnectionOperation and AFHTTPClient --- AFNetworking/AFHTTPClient.m | 4 ++-- AFNetworking/AFURLConnectionOperation.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index 1c1feb5..96a7060 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -657,8 +657,8 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {} return nil; } - self.stringEncoding = [aDecoder decodeIntegerForKey:@"stringEncoding"]; - self.parameterEncoding = [aDecoder decodeIntegerForKey:@"parameterEncoding"]; + self.stringEncoding = (NSStringEncoding)[aDecoder decodeIntegerForKey:@"stringEncoding"]; + self.parameterEncoding = (AFHTTPClientParameterEncoding)[aDecoder decodeIntegerForKey:@"parameterEncoding"]; self.registeredHTTPOperationClassNames = [aDecoder decodeObjectForKey:@"registeredHTTPOperationClassNames"]; self.defaultHeaders = [aDecoder decodeObjectForKey:@"defaultHeaders"]; diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index cf9741c..db8c0fe 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -603,7 +603,7 @@ didReceiveResponse:(NSURLResponse *)response return nil; } - self.state = [aDecoder decodeIntegerForKey:@"state"]; + self.state = (AFOperationState)[aDecoder decodeIntegerForKey:@"state"]; self.cancelled = [aDecoder decodeBoolForKey:@"isCancelled"]; self.response = [aDecoder decodeObjectForKey:@"response"]; self.error = [aDecoder decodeObjectForKey:@"error"];