I’m trying to use NSURLConnection to “talk” to a server but when trying to use initWitRequest I get this error:
no known class method for selector 'initWithRequest:delegate:'
Is this not a proper usage of the method?
NSURLConnection *conn = [NSURLConnection initWithRequest:theRequest delegate:self];
My Deployment Target is iOS 4.3. Under Base SDK it has listed Latest iOS (iOS 5.0). Could this be an issue?
You’re attempting to send
-initWithRequest:delegate:to theNSURLConnectionclassinstead of an instance of that class.By convention, any
-initmethod should be preceded by a message toallocon the class. In your example,connwould be created like so:NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];