Note that there are some explanatory texts on larger screens.

plurals
  1. POXCode will not recognize custom method
    primarykey
    data
    text
    <p>I have a custom NSObject class called "GREST", everything works aside from this method. Auto completion won't even recognize it, and I honestly can't figure out why. I've tried changing the method's name and everything. When I call the method, it works, I just get the warning that the class may not respond to this method.</p> <p>I have this method declared in my header file</p> <pre><code>- (void)connect:(NSString *)connection_url parameters:(NSString *)parameter_string header:(NSString *)header_type </code></pre> <p>And here is the implementation</p> <pre><code>- (void)connect:(NSString *)connection_url parameters:(NSString *)parameter_string header:(NSString *)header_type { NSData *request_data = [parameter_string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *request_length = [NSString stringWithFormat:@"%d", [request_data length]]; response_data = [[NSMutableData alloc] init]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:connection_url]]; [request setHTTPMethod:@"POST"]; [request setValue:request_length forHTTPHeaderField:@"Content-Length"]; if([header_type isEqualToString:@""] || header_type == nil || header_type == NULL) { [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; } else { [request setValue:header_type forHTTPHeaderField:@"Content-Type"]; } [request setHTTPBody:request_data]; [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; [request setTimeoutInterval:10]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; if(!connection) { [self apicall_failed]; } [connection release]; } </code></pre> <p>When I try to call this method, XCode gives me the following warning</p> <pre><code>'GREST' may not respond to '-connect:parameter_string:header_type:' </code></pre> <p><strong>Edit, here's how the code is being called:</strong></p> <pre><code>GREST *api = [[GREST alloc] init]; [api setDelegate:self]; [api connect:@"http://domain.com" parameter_string:@"{'username':'hi'}" header_type:@"application/json"]; [api release]; </code></pre> <p>Everything works fine, but I'm just trying to get rid of this warning now. Any ideas on how I can do this? Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload