I don't know if that's the case here but I had same issue with URLWithString function appears only on iOS 7.0.3, I assume Apple has change the characters this function can use so if it returns nil this is your solution.
What I did is using this function to create the string before using it with URLWithString:
-(NSString *) URLEncodeString:(NSString *) str // New to fix 7.0.3 issue //
{
NSMutableString *tempStr = [NSMutableString stringWithString:str];
[tempStr replaceOccurrencesOfString:@" " withString:@"+" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [tempStr length])];
return [[NSString stringWithFormat:@"%@",tempStr] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
On your case just change the line to this one:
dispatch_async(dispatch_get_main_queue(), ^{ NSData *data =
[NSData dataWithContentsOfURL:[NSURL URLWithString:[self URLEncodeString: [NSString stringWithFormat: @"http://www.someurl.com/mobile-api"]]]];
[self performSelectorOnMainThread:@selector(fetchData:) withObject:data
waitUntilDone:YES]; });
Hope that would help you too.