I get the warning Incompatible pointer types assigning to ‘NSHTTPURLResponse *’ from ‘NSURLResponse *’ in the code below. This method is part of Sharekit.
The line with the warning is the bolded/italicized one:
- (void)connection:(NSURLConnection *)aConnection didReceiveResponse:(NSURLResponse *)aResponse
{
if (response)
[response release];
***response = [aResponse retain];***
[responseData setLength:0];
}
Someone please help!
Thanks!
To the compiler,
aResponse, and the result of[aResponse retain], is an NSURLResponse. However I’m guessingresponseis an NSHTTPURLResponse. Since NSURLResponse is a superclass of NSHTTPURLResponse, you can’t just assign directly — but you can use a cast to remove the warning: