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 6605025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:14:03+00:00 2026-05-25T19:14:03+00:00

I have almost finished working my way through this tutorial here Its really informative

  • 0

I have almost finished working my way through this tutorial here
Its really informative and has helped me understand how protocols and delegates work together for passing data around.

However I have one warning that poping up when I try to tell my subview that the mainview is its delegate. its sending back this warning

“+setDelegate:’ not found (return type defaults to ‘id’)”

Everything was on track up till that point and I am just woundering what this error means and if it is anything to do with the way I have implemented my code.

below is where the warning is happening…

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    //--- Idendify selected indexPath (section/row)
    if (indexPath.section == 0) {
        //--- Get the subview ready for use
        VehicleResultViewController *vehicleResultViewController = [[VehicleResultViewController alloc] initWithNibName:@"VehicleResultViewController" bundle:nil];
        // ...
        //--- Sets the back button for the new view that loads
        self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style: UIBarButtonItemStyleBordered target:nil action:nil] autorelease];

        // Pass the selected object to the new view controller.
        [self.navigationController pushViewController:vehicleResultViewController animated:YES];

        [VehicleResultViewController setDelegate:self]; //<<-- warning here says -->> Method'+setDelegate:' not found (return type defaults to 'id')

        switch (indexPath.row)
        {
                case 0: vehicleResultViewController.title = @"Manufacture";
                [vehicleResultViewController setRequestString:@"manufacture.php"]; //sets the request string in searchResultsViewController
                break;
//...

Any help would be greatly appreciated.

Updated, this is how I set my delegate up
SecondView.h

//...
@interface VehicleResultViewController : UITableViewController <NSXMLParserDelegate> {
//..
    id <PassSearchData> delegate;
}
//..
@property (retain) id delegate;

@end

SecondView.m

//..
@synthesize delegate;
//..
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [[self delegate] setVehicleSearchFields:vehicleCellTextLabel];
}
//..

I hope this better clarifies what I am doing.

  • 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-25T19:14:04+00:00Added an answer on May 25, 2026 at 7:14 pm

    You are calling an instance method on a class.

    This line:

    [VehicleResultViewController setDelegate:self];
    

    should be:

    [vehicleResultViewController setDelegate:self];
    

    The first line calls setDelegate on VehicleResultViewController, which is the name of the class. Since setDelegate is not a class method the compiler complains.

    The corrected line calls setDelegate on vehicleResultViewController, which is an instance of the class that you allocated. This will work because setDelegate is an instance method.

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

Sidebar

Related Questions

I have been working with linux server using epoll and almost finished it. And
Thanks to this site and your help, I have almost finished my Googlemaps script.
I have been almost finished (well i thought i finished) writing this login page
I am really stuck on this one. Website is almost finished. Just trying to
I'm working on a homework assignment for CS1, and I almost have it finished
Here's the site in question: http://cbcsettlementfunding.com/dev/ Almost finished up with development, just have a
I am trying to make my own user control and have almost finished it,
I'm almost finished with my program, but I have one problem that I can't
G'day guys, currently have almost finished writing a rails application that allows a CSV
Recently, I finished reading K&R with its, almost all, exercises and examples. I was

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.