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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:26:25+00:00 2026-05-28T06:26:25+00:00

I am getting this error [ResultViewController setSearchFields:IndexPath:]: unrecognized selector sent to instance 0xc448840 I

  • 0

I am getting this error

[ResultViewController setSearchFields:IndexPath:]: unrecognized selector sent to instance 0xc448840

I have a navigation controller stack in which I am using delegates to pass information back to a previous view in the navigation stack.. However I think I am doing something wrong when I am declaring the delegate.

My navigation stack looks like this.

view 0 (mainmenu)
-- view 1 (SearchViewController)
--- view 2 (ResultViewController) - where I set the delegate of the new view being loaded
---- View 3 (SubViewController) - this is where my delegates reside

What I am doing is popping to view1 and passing the delegate information to that view however by doing so I am getting this error… I am wondering if I have to set the delegate for view 3 in view 1 where I end up passing the information… is that correct??

If so what do I have to think about when setting the delegate? How do I call it from view 1

This is how I’m setting up my delegate in SubViewController

subvc.h

@protocol PassSubSearchData <NSObject>
@required
- (void) setSearchFields:(NSArray *)modArray IndexPath:(NSIndexPath *)modIndexPath;
@end

@interface VehicleSubResultViewController : UITableViewController <NSXMLParserDelegate> {
//..
 //Delegate for passing Mod and SubMod data back to VehicleSearchViewController
    id <PassSubSearchData> delegate;
//..
//Delegate for passing Mod and SubMod data back to VehicleSearchViewController
@property (strong) id delegate;

subvc.m

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //Access selected cells content (cell.textLabel.text)
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    //Predicates restrict the values that will be returned from the query.
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like %@",@"SUB",cell.textLabel.text];
    filterArray = [parsedDataArrayOfDictionaries filteredArrayUsingPredicate:predicate];

    [[self delegate] setSearchFields:tempModArray IndexPath:tempModIndexPath];

    //This pops to the View 1 - SearchViewController
    [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];

}

Then In my SearchViewController this is how I am setting the delegate stuff up

searchvc.h

#import "SubViewController.h"

@interface SearchViewController : UITableViewController <PassSubSearchData> {
//..

searchvc.m

- (void) setSearchFields:(NSArray *)modArray IndexPath:(NSIndexPath *)modIndexPath
{
    modSearchObjectString = [[modArray valueForKey:@"MOD"] objectAtIndex:0];
    modSearchIndexPath = modIndexPath; // Sets the selected IndexPath from the subview


    NSLog(@"%@", modSearchObjectString);
    NSLog(@"%@", modResultIndexPath);



    [self.tableView reloadData]; 
}

That pretty much sums it up.. sorry for the delay.

  • 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-28T06:26:26+00:00Added an answer on May 28, 2026 at 6:26 am

    So from what I can tell, storing the information into a file and then bringing it back down when it is needed might be a simpler way to achieve what you want. Something (I know, oversimplified) like this:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        //store the cell's title into a string
        NSString* string = [[[tableView cellForRowAtIndexPath:indexPath] textLabel] text];
    
        [[NSUserDefaults standardUserDefaults] setObject:string forKey:@"someKey"];
    }
    

    Later you can get that string back by using:

    NSString* titleString = [[NSUserDefaults standardUserDefaults] objectForKey:@"someKey"];
    

    You can proceed in this same way with the information that you need to transfer.

    Another alternative is to create a property in the view controller receiving the data:

    @property(nonatomic, retain) NSString* string; //you need to synthesize it in the .m file too
    

    then before you pop to the view controller you do:

    //make sure you cast it
    (SearchViewController*)[self.navigationController.viewControllers objectAtIndex:1].string = @"some string";
    

    then once you go to that controller, that property will be set with whatever string you set it to in

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    

    And in these ways you can pass information between view controllers. Good luck!

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

Sidebar

Related Questions

Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Anyone getting this error when using the new free chart controls MS bought from
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
Keep getting this error after inserting a subdatasheet into a query and trying to
am getting this error when i open my site in internet explorer......... plz help
I am getting this error now that I hit version number 1.256.0: Error 4
I am getting this error when trying to run internet information services on a
I am getting this error but only very occasionally. 99.9% of the time it
I'm getting this error on a compact framework form. code generation for property 'inputControl'

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.