Merge pull request #2210 from svenluzar/master

ApiClient Bugfix: containsString removed to support iOS 7
This commit is contained in:
wing328 2016-02-24 00:31:55 +08:00
commit 23696c5eb3

View File

@ -136,7 +136,8 @@ static void (^reachabilityChangeBlock)(int);
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
for (NSString *string in accepts) {
NSString * lowerAccept = [string lowercaseString];
if ([lowerAccept containsString:@"application/json"]) {
// use rangeOfString instead of containsString for iOS 7 support
if ([lowerAccept rangeOfString:@"application/json"].location != NSNotFound) {
return @"application/json";
}
[lowerAccepts addObject:lowerAccept];