Can anyone tell me why I can't return a NSMutableArray there:
-(NSMutableArray)makeServiceRequest:(UIViewController *)sender
{
NSMutableString *urlString= [NSString stringWithFormat:@"http://www.servicedata/%@", _searchValue];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData* data = [NSData dataWithContentsOfURL:
[NSURL URLWithString: urlString]];
NSError* error;
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
dispatch_async(dispatch_get_main_queue(), ^(){
NSLog(@"json arrived");
return json;
});
});
}
I've it well declared on the header file. And is there any way to turn that into a class method?