Ever since I added this async request, I’m getting an xcode error of Sending 'NSError *const __strong *' to parameter of type 'NSError *__autoreleasing *' changes retain/release properties of pointer
...
[NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLData:data error:&error];
...
});
}];
...
If I use error:nil then my code runs fine, but I feel uneasy about not using errors.. What should I do?
Presumably it’s because you’re reusing the
errorpassed in to you in the completion handler. It’ll be being passed as__strongand then you pass it in where it is required to be__autoreleasing. Try changing to this code: