You'd do something like this...
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
NSError *error = nil;
NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error: &error];
if (error) {
// you have to show the alert on the main thread
dispatch_async(dispatch_get_main_queue, ^(void) {
[[[UIAlertView alloc] initWithTitle:@"Error" message:error.userInfo delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
});
}
});
You'll probably want to display your own message based on the error instead of just showing the error.