From 99a758dc474809ace92336934c4627dd5215090d Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Thu, 3 Oct 2013 16:06:14 -0700 Subject: [PATCH 1/2] Fix up format Remove leftover portion of error message, where format string uses an argument that no longer is passed, causing the error message to have a random number added to it: Request failed: %@ (%d), got %d The ", got %d" portion is a left-over from a previous iteration of the message, and the value it expects is now the one provided in the parentesis before it. --- AFNetworking/AFURLResponseSerialization.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFNetworking/AFURLResponseSerialization.m b/AFNetworking/AFURLResponseSerialization.m index 5fa0f0a..14f2a31 100644 --- a/AFNetworking/AFURLResponseSerialization.m +++ b/AFNetworking/AFURLResponseSerialization.m @@ -60,7 +60,7 @@ extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey; if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode]) { NSDictionary *userInfo = @{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%d), got %d", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], response.statusCode], + NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%d)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], response.statusCode], NSURLErrorFailingURLErrorKey:[response URL], AFNetworkingOperationFailingURLResponseErrorKey: response }; From 586638b2d2f8ac3f70950204c2e017db79857e23 Mon Sep 17 00:00:00 2001 From: Josh Avant Date: Thu, 3 Oct 2013 19:00:16 -0700 Subject: [PATCH 2/2] Change `AFHTTPRequestOperation` `-(id)initWithCoder:` to call the `super` implementation This change allows an instance of AFHTTPRequestOperation to be more completely archived. --- AFNetworking/AFHTTPRequestOperation.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index a255615..7765f2a 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -123,9 +123,7 @@ static dispatch_group_t http_request_operation_completion_group() { #pragma mark - NSCoding - (id)initWithCoder:(NSCoder *)aDecoder { - NSURLRequest *request = [aDecoder decodeObjectForKey:@"request"]; - - self = [self initWithRequest:request]; + self = [super initWithCoder:aDecoder]; if (!self) { return nil; }