I had the NSURLConnection and all the appropriate methods working in one view controller. Then i moved it to a UICollectionViewController and get an exception below
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSError *jsonParsingError = nil;
//error right here!
NSString
*object = [NSJSONSerialization JSONObjectWithData:self.jsonReceivedData options:NSJSONReadingMutableContainers error:&jsonParsingError];
if (jsonParsingError) {
NSLog(@"JSON ERROR: %@", [jsonParsingError localizedDescription]);
} else {
NSLog(@"LIST: %@", object);
}
}
The error is: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
Anyone have any ideas?