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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:56:55+00:00 2026-05-27T17:56:55+00:00

I have two TableViewControllers with a segue in-between. When a user clicks on a

  • 0

I have two TableViewControllers with a segue in-between. When a user clicks on a cell in the first TVC they get presented with the second TVC. The segue is modal, has an identifier called “segueToLocationDetails” and passes an object along with it. You can think of the second TVC as a “details” page more or less.

My code works perfectly in the scenario that I’ve described above. It breaks however as soon as I embed the second TVC into a navigation controller.

Example. I have it working perfectly. I then highlight the second TVC in IB, mouse over to Product | Embed in | Navigation controller. Now the second TVC is in a Nav Controller. The segue however still points to the second TVC. I remove the segue and reconnect it from the first TVC’s cell to the Navigation Controller and be sure give the segue an identifier. Run again, and it breaks! The error is below…

2011-12-23 15:30:45.469 Project12[5219:11603] -[UINavigationController
setDetailsObject:]: unrecognized selector sent to instance 0x7b92ce0
2011-12-23 15:30:45.471 Project12[5219:11603] * Terminating app due
to uncaught exception ‘NSInvalidArgumentException’, reason:
‘-[UINavigationController setDetailsObject:]: unrecognized selector
sent to instance 0x7b92ce0’
*
First throw call stack: (0x16ea052 0x150ad0a 0x16ebced 0x1650f00 0x1650ce2 0x3933 0x703e1e 0x36f6d9 0x36f952 0xbf786d 0x16be966
0x16be407 0x16217c0 0x1620db4 0x1620ccb 0x14ec879 0x14ec93e 0x2dfa9b
0x2a98 0x29f5 0x1) terminate called throwing an exceptionCurrent
language: auto; currently objective-c

Some code is below to help explain:

AllLocations.h & AllLocations.m (this is the master table)

AllLocations.h

@interface AllLocations : UITableViewController
{
    SQLiteDB *mySQLiteDB;
}
@property (nonatomic, strong) NSMutableArray *locationsArray;



AllLocations.m

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"segueToLocationDetails" sender:self];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"segueToLocationDetails"]) 
    {
        NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow];
        NSInteger rowNumber = selectedIndexPath.row;

        mySQLiteDB = (SQLiteDB *) [locationsArray objectAtIndex:rowNumber];

        DetailsTVC *detailsTVC = [segue destinationViewController];

        detailsTVC.detailsObject = mySQLiteDB;        
    }
}

DetailsTVC.h & DetailsTVC.m (this is the detailed table view)

DetailsTVC.h

@interface DetailsTVC : UITableViewController

@property (nonatomic, strong) SQLiteDB *detailsObject;


DetailsTVC.m

@implementation SpotDetailsTVC

@synthesize spotDetailsObject;

Note: I left out all of the code that was not really important or relevant to the question.

Again: This works perfectly if the segue goes from the Originating TableVeiwController to the other TableViewController. It only breaks when I embed the second TVC in a Nav Controller. I need to know how to get this working with the Nav Controller in the picture. Thanks in advance!

  • 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-27T17:56:55+00:00Added an answer on May 27, 2026 at 5:56 pm

    DetailsTVC *detailsTVC = [segue destinationViewController];

    That line is incorrect. Since your second TVC is now embedded in a navigation controller, [segue destinationViewController] is now a UINavigationController. This should work:

    DetailsTVC *detailsTVC = [[segue destinationViewController] visibleViewController];

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

Sidebar

Related Questions

I have two Hibernate data object. The first is a User (with unique id,
I have two different Classes: class X { public int TX1 { get; set;
I have two View Controllers: TableViewController (which is used as a modal view controller)
I have two collections, the first with an array of id's referencing documents in
I have two BizTalk 2010 servers that belong to the same BizTalk group. They
Have two tables named Employee and Order. The relations between the tables Employee (1)
have two three tables one for student, second for class, and the third for
I have two tables: Users and Profiles. A user may have a profile and
Have two UIBarButtonItems want to make it as one UIBarButtonItem and toggle between them
Have two tables with a linking table between them. USERS +-------+---------+ | userID| Username|

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.