Estoy empezando a jugar con ARC, y uno de los primeros experimentos que intenté fue realizar una llamada HTTP a una URL y recuperar algunos datos. Por supuesto, el código de estado HTTP es importante para mí, lo que significa que fui a mi "Goto" de utilizar sendSynchronousRequest
como:NSURLConnection sendSynchronousRequest con ARC
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *responseCode = nil;
NSData *oResponseData = [NSURLConnection sendSynchronousRequest:request returningResponse:responseCode error:error];
Con ARC permitió llego a errores y advertencias del compilador en la última línea.
errores:
Implicit conversion of an Objective-C pointer to 'NSURLResponse *__autoreleasing *' is disallowed with ARC
Implicit conversion of an Objective-C pointer to 'NSError *__autoreleasing *' is disallowed with ARC
file://localhost/Users/jason/Projects/test/Data/DataService.m: error: Automatic Reference Counting Issue: Implicit conversion of an Objective-C pointer to 'NSURLResponse *__autoreleasing *' is disallowed with ARC
file://localhost/Users/jason/Projects/test/Data/DataService.m: error: Automatic Reference Counting Issue: Implicit conversion of an Objective-C pointer to 'NSError *__autoreleasing *' is disallowed with ARC
Advertencias:
Incompatible pointer types sending 'NSHTTPURLResponse *_strong' to parameter of type 'NSURLResponse *_autoreleasing *'
Incompatible pointer types sending 'NSError *_strong' to parameter of type 'NSError *_autoreleasing *'
De lo que puedo decir el paso de referencia es lo que está metiendo con esto, pero estoy seguro de lo que la forma correcta de resolver esto es ¿Hay una forma "mejor" de realizar una tarea similar con ARC?
¡LOL ... me sirve para tratar de pensar después de las vacaciones! –