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

  • Home
  • SEARCH
  • 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 6782903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:47:58+00:00 2026-05-26T16:47:58+00:00

I have a Tab Bar with a navigation table view. My app crashes when

  • 0

I have a Tab Bar with a navigation table view. My app crashes when I select a cell on my table view. I want a new viewcontroller to open when a cell is selected. My guess is that I am not pushing it correctly when didselectrowatindexpath is called. The app stays hung up for a few seconds then closes.

Does anything catch your eye with this code? Or do you have any sample code? I am using Xcode 3 with simulator 4.3.

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        NSInteger row = [indexPath row];
        if (self.vailViewController == nil) {
            VailViewController *vailView = [[VailViewController alloc]  initWithNibName:@"View" bundle:nil];
            self.vailViewController = vailView;
            [vailView release];
        }

        vailViewController.title = [NSString stringWithFormat:@"%@", [resortsArray  objectAtIndex:row]];
        Ski_AdvisorAppDelegate *delegate = (Ski_AdvisorAppDelegate *)[[UIApplication  sharedApplication] delegate];
        [delegate.resortsNavController pushViewController:vailViewController animated:YES];
        [self.navigationController pushViewController:vailViewController animated:YES];
}

Thanks a lot!

  • 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-26T16:47:59+00:00Added an answer on May 26, 2026 at 4:47 pm
    if (self.vailViewController == nil) {
            VailViewController *vailView = [[VailViewController alloc]  initWithNibName:@"View" bundle:nil];
            self.vailViewController = vailView;
            [vailView release];
        }
    

    In this block of code is your view file actually named “View.xib” because if not this is your crash. With this error message

    * Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Could not load NIB in bundle: ‘NSBundle (loaded)’ with name ‘View”

    So if you want to load this with initWithNibName and your files are named as such:

    VailViewController.h
    VailViewController.m
    VailViewController.xib

    you need:

    VailViewController *vailView = [[VailViewController alloc]  initWithNibName:@"VailViewController" bundle:nil];
    

    However if it is a standard UIViewController subclass you should only need to do:

    VailViewController *vailView = [[VailViewController alloc] init];
    

    The above works if you just created a UIViewController subclass in Xcode and didn’t change anything. The view controller knows how to load it’s own view. If you had it create an .xib file for you and you deleted something in it or just arn’t sure make sure the File’s Owner is wired up to the root view in the .xib file in interface bulder.

    I hope that helps.

    Edit:

    The error in your comments:

    * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Pushing the same view controller instance more than once is not supported

    is coming these two lines in your code:

    [delegate.resortsNavController pushViewController:vailViewController animated:YES];
    [self.navigationController pushViewController:vailViewController animated:YES];
    

    I should ask if these are two different navigation controllers? if so why do they need the exact same view controller pushed to them?

    I would remove one of them and then it should push the view controller without error.

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

Sidebar

Related Questions

I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have root view with both tab bar and navigation bar visible at the
I have an app, which has a top navigation bar and a bottom tab
My problem is that I want to have a tab bar view with its
I have a tab bar + navigation based app and I'd like to launch
hey guys, I created a Table View with Navigation Controller, in a Tab Bar
I have a Tab Bar controller inside a Navigation controller. I want to create
I have a tab bar driven app. The app has some view controllers that
If have a Navigation Bar and a Tab Bar in one of my views.
In my app I have a tab bar. And in some views I as

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.