I'm using the XMLRPC library that is set up to handle ARC and non-ARC projects. When i try to pass it a NSError object, i'm getting the error:
Implicit conversion of an Objective-C point to 'NSError *_autoreleasing *' is disallowed with ARC
and a warning:
Incompatible point types sending 'NSError *_strong' to parameter of type 'NSError *_autoreleasing *'
here is the method:
+ (XMLRPCResponse *)sendSynchronousXMLRPCRequest: (XMLRPCRequest *)request error: (NSError **)error {
NSHTTPURLResponse *response = nil;
#if ! __has_feature(objc_arc)
NSData *data = [[[NSURLConnection sendSynchronousRequest: [request request] returningResponse: &response error: error] retain] autorelease];
#else
NSData *data = [NSURLConnection sendSynchronousRequest: [request request] returningResponse: &response error: error];
#endif
if (response) {
NSInteger statusCode = [response statusCode];
if ((statusCode < 400) && data) {
#if ! __has_feature(objc_arc)
return [[[XMLRPCResponse alloc] initWithData: data] autorelease];
#else
return [[XMLRPCResponse alloc] initWithData: data];
#endif
}
}
return nil;
}
Here is my attempt to call it:
NSError *myError;
XMLRPCResponse *serverResponse = [XMLRPCConnection sendSynchronousXMLRPCRequest:request error:myError];
I guess i am unfamiliar with the
#if
syntax, but i'm guessing it acts just like a regular If statement?
I also have ARC enabled:
Should i just redo the XMLRPCResponse method to remove handling of non-ARC projects or is there a reason i'm getting the error/warning?