Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5951687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:34:24+00:00 2026-05-22T17:34:24+00:00

I have a custom NSObject class called GREST, everything works aside from this method.

  • 0

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.

I have this method declared in my header file

- (void)connect:(NSString *)connection_url parameters:(NSString *)parameter_string header:(NSString *)header_type

And here is the implementation

- (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];

}

When I try to call this method, XCode gives me the following warning

'GREST' may not respond to '-connect:parameter_string:header_type:'

Edit, here’s how the code is being called:

GREST *api = [[GREST alloc] init];
[api setDelegate:self];
[api connect:@"http://domain.com" parameter_string:@"{'username':'hi'}" header_type:@"application/json"];
[api release];

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:34:24+00:00Added an answer on May 22, 2026 at 5:34 pm

    compare the method names:

    '-connect:parameter_string:header_type:'
    

    to

    '-connect:parameters:header:'
    

    the difference is that you are using the names of the method’s arguments, not the actual method/selector. this will result in a runtime exception when called.

    the compiler will tell you the line where you try to use the former, and xcode will probably highlight the line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an custom UIVIewController that is the base class for other controllers and
I have a custom object like: #import <Foundation/Foundation.h> @interface FaxRecipient : NSObject { NSString
I need to extract an array of a single property from a custom object
I have custom groupViews that need to change state when they are expanded and
I have custom membership and role provider (C#) in my .net 4 (webform based)
I have custom radar tiles that I am trying to overlay over Google Maps
I have custom MSBuild project file with few <ProjectReferences> . I'm calling the <MSBuild
I have custom page and id of list item. How can i show sharepoint
I have a listview in which i wanted to have custom typeface e.g. Arial.
I want to store a bunch of key value pairs, with the key being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.