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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:53:20+00:00 2026-05-28T03:53:20+00:00

I am passing some information from one view to the other using delegates, However

  • 0

I am passing some information from one view to the other using delegates, However when I select a tableview cell I am passing the data to the delegate that will pas the information back to a view on the stack.. it makes it back to that view but doesn’t actually go into the delegate method when the views change…

Here is where I set up my delegate.

subViewController.h

#import <UIKit/UIKit.h>

@protocol PassSubSearchData <NSObject>
@required
- (void) setModSearchFields:(NSArray *)modArray modIndexPath:(NSIndexPath *)modIndexPath setSubMod:(NSArray *)subModArray subModIndexPath:(NSIndexPath *)subModIndexPath;
@end

//...

//Delegate for passing Model and SubModel data back to VehicleSearchViewController
    id <PassSubSearchData> delegate;

//...

//Delegate for passing Model and SubModel data back to VehicleSearchViewController
@property (strong) id delegate;

//This is how I use it

subViewController.m

#import "MainViewController.h"
#import "SubViewController.h"

@implementation VehicleSubResultViewController


//...

//Delegate for passing Model and SubModel data back to VehicleSearchViewController
@synthesize delegate;

//...

#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] setModSearchFields:tempModArray modIndexPath:tempModIndexPath setSubMod:filterArray subModIndexPath:indexPath];

    //This pops to the VehicleSearchViewController view
    [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];

}

Then in the main view

MainViewController.h

#import "SubViewController.h"

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

MainViewController.m // However this part of the code is never accessed

- (void) setModSearchFields:(NSArray *)modArray modIndexPath:(NSIndexPath *)modIndexPath setSubMod:(NSArray *)subModArray subModIndexPath:(NSIndexPath *)subModIndexPath
{
    modObjectString = [[modArray valueForKey:@"MOD"] objectAtIndex:0];
    modIndexPath = modIndexPath; // Sets the selected IndexPath from the subview

    subModObjectString = [[modelArray valueForKey:@"SUBMODEL"] objectAtIndex:0];
    subModIndexPath = subModResultIndexPath; // Sets the selected IndexPath from the subview

    NSLog(@"%@", modObjectString);
    NSLog(@"%@", modIndexPath);
    NSLog(@"%@", subModObjectString);
    NSLog(@"%@", subModIndexPath);


    [self.tableView reloadData]; 
}

So thats it, I’m just not sure what I’m missing if anyone knows any help would be appreciated.

  • 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-28T03:53:20+00:00Added an answer on May 28, 2026 at 3:53 am

    Most likely the delegate never got set, so it is nil and nothing happens.

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

Sidebar

Related Questions

I am passing an NSDictionary object from one view class to another as I
I'm currently passing some date-time info to a web page using url parameters, which
Possible Duplicate: C++ passing variables in from one Function to the Next. The Program
I am looking for a quick way to grab some data off of one
Good day, I am retrieving information from various websites using cURL and various parsing
I have a form on a website that takes in some personal information from
In ASP.net MVC: How should/Can I pass Form data (From the View) to the
I extract some information from the html sourcecode of different pages with jsoup. Most
I'm passing some numeric arguments while creating a process (in VC++) I'm stuck at
I'm passing some parameters to a CR report programatically and it was working fine,

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.