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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:14:24+00:00 2026-06-15T22:14:24+00:00

I have searched up and down on this and found a few that were

  • 0

I have searched up and down on this and found a few that were similar but not my exact problem. In my detail view controller I have a segue that opens a popover table view controller. In the PrepareForSegue method, I set a property of the table view, like so:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"StateSegue"])
    {
        popover = [(UIStoryboardPopoverSegue *)segue popoverController];
        StatePickerController *statePicker = (StatePickerController *)popover.contentViewController;
        statePicker.delegate = self;
        statePicker.pickerType = @"states";
    }
}

I pass both the delegate and the pickerType value. In my table view, StatePickerController, in the header I declared these properties like this:

@property (nonatomic,assign) id<StatePickerDelegate> delegate;
@property (nonatomic,strong) NSString *pickerType;

I know these values are getting passed into my popover controller correctly because later on in didSelectRowAtIndexPath I can reference them both and I get the right delegate and “state”, however in the viewDidLoad method, both are still (null).

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.clearsSelectionOnViewWillAppear = NO;
    self.contentSizeForViewInPopover = CGSizeMake(150.0, 140.0);
    self.states = [NSMutableArray array];
    NSLog(@"%@",self.delegate); //returns (null)
    NSLog(@"%@",self.pickerType); //returns (null)
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%@",self.pickerType); //corectly logs "state"
    NSString *state = [_states objectAtIndex:indexPath.row];
    [self.delegate stateSelected:state]; //correctly runs method on detailviewcontroller
}

Is there some point after the viewDidLoad method where these properties get set? I need access to these values right when the view loads because I need to determine what data populates in the table based on what is passed from the detailviewcontroller.

  • 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-06-15T22:14:25+00:00Added an answer on June 15, 2026 at 10:14 pm

    viewWillAppear is called after viewDidLoad. Use that instead to check the values after the prepareForSegue method.

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

Sidebar

Related Questions

I have searched the forum and have not found an issue similar to this.
I have searched for this, and i found that for api less than 12,
i have searched the web relentlessly for this and have not found anything -
I've searched and searched but have not found a script capable of downloading files
I guess this question that would have already been asked here. I searched but
I have searched for hours but could not find anything similar. The crash has
I have searched up and down the internet for a jQuery widget that does
I have searched for a general solution to this but only find answers to
I have searched and searched for this but I think my terminology isn't correct
I have searched for this topic but nothing seems to be helping me with

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.