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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:02:55+00:00 2026-05-31T21:02:55+00:00

I am still new to the storyboard stuff. I spent two days debugging this

  • 0

I am still new to the storyboard stuff. I spent two days debugging this problem. It seems the destination view controller of a segue is not working properly when the -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender is called.

I have a table view and when a cell is tapped, it calls for a segue

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    VAItem *item = [category itemAtIndex:indexPath.row];
    [self performSegueWithIdentifier:@"SegueShowDetail" sender:item];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"SegueShowDetail"]) {

        VADetailViewController *detailViewController = segue.destinationViewController;
        detailViewController.item = (VAItem*) sender; // <-- THIS ASSIGNMENT DOES NOT WORK       
    }
}

My debugging shows, the item is correctly passed down to prepareForSegue but the detailViewController.item is a wild pointer. It’s not initialized and the = assignment does not have any effect.

I put a breakpoint in VADetailViewController’s viewDidLoad and found out that the item variable is still the wild pointer address even though the assignment has taken place.

@interface VADetailViewController : UIViewController
// data
@property (nonatomic, retain) VAItem *item;
@end

item is also correctly synthesized.

Any help is much appreciated

Leo

  • 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-31T21:02:56+00:00Added an answer on May 31, 2026 at 9:02 pm

    If you’re using a storyboard segue to transition to the next viewcontroller you don’t need to use tableVeiew:didSelectRowAtIndexPath: in this situation. Depending how you have things set up that could be contributing to the problem.

    In your storyboard, make sure you have drawn your push segue from your tableview’s Prototype Cell to the detail view controller (i.e. from the cell, NOT from the tableViewController). If you have your storyboard set up that way your segue will be triggered as soon as the user selects a cell. A reference to the cell itself will be passed to prepareForSegue:sender: as the sender parameter. You can then inspect that object to find out which row was clicked in that method.

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if ([segue.identifier isEqualToString:@"SegueShowDetail"]) {
    
            // sender will be the tableview cell that was selected
            UITableViewCell *cell = (UITableViewCell*)sender;
            NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    
            VAItem *item = [category itemAtIndex:indexPath.row];
    
            VADetailViewController *detailViewController = segue.destinationViewController;
            detailViewController.item = item;       
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am still new to this Memory Management stuff (Garbage Collector took care of
i am still new to the Java language and libraries... i often use this
I'm still new top rspec, so please excuse if this is an easy one
I'm still new to the Ada programming world so forgive me if this question
Still new to python and django, though learning ;-) I have a view that
I am still new to MVC, so sorry if this is an obvious question:
I'm still new to ROR, so pardon the simplicity of the question... So http://www.example.com/controller/:id
Still new to .NET, but this looks OK to me. I can't figure out
This line works fine :- Storyboard.SetTargetProperty(animation, new PropertyPath(ShiverDirection == Orientation.Horizontal ? X : Y));
I'm still new to web app development, so bear with me if this sounds

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.