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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:50:56+00:00 2026-05-23T20:50:56+00:00

I have an iphone app that has a root view with a button that

  • 0

I have an iphone app that has a root view with a button that suppose to lead to a tab bar view. when you click on the UIbutton in the root view, it triggers an IBAction method that does the code below. From some reason it crashes towards the end. Any ideas? Would be happy to get any help…Thanks!!

rootview.h

@interface RootView : UIViewController

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) UITabBarController *tabBarController;

@end

rootview.m

-(IBAction)GoToTabBarView:(id)sender {

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *viewController1 = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
UIViewController *viewController2 = [[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];


 }

The app crashes here:

self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];

What am I doing wrong? Thanks!!

CRASH LOG:

2011-07-20 11:45:37.359 MyTabProject[17929:207] <FirstView: 0x6836070> <SecondView: 0x683c770>
2011-07-20 11:45:37.410 MyTabProject[17929:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "FirstView" nib but the view outlet was not set.'
*** First throw call stack:
(0xf8c600 0x112452e 0xf31f59 0xf31ec9 0xdbe80 0xdc35d 0xdc57f 0xf6ec5 0xf6d13 0xf5438 0xf5264 0xf4f11 0xf42c6 0x4c93 0xf8dd78 0x1acc5 0x1ac5a 0xbfbd4 0xc009d 0xbee8c 0x3ff13 0x4022d 0x26990 0x1a1a7 0x136b886 0xf5bd11 0xebdc9b 0xebc4b1 0xebb93c 0xebb868 0x1369fef 0x136a0b4 0x180c4 0x2a99 0x2a05)
terminate called throwing an exception(gdb) 
  • 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-23T20:50:56+00:00Added an answer on May 23, 2026 at 8:50 pm

    It’s hard to say without having any error information. But have you tried

    NSMutableArray *listOfViewControllers = [[NSMutableArray alloc] init];
    UIViewController *vc;
    
    vc = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
    [listOfViewControllers addObject:vc];
    [vc release];
    vc = [[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
    [listOfViewControllers addObject:vc];
    [vc release];
    
    [self.tabBarController.viewControllers setViewControllers:listOfViewControllers]; 
    

    Also, are you sure that your nibs exist? You should use the bundle:

    [[FirstView alloc] initWithNibName:@"FirstView" bundle:NSBundle.mainBundle];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app that hides the status bar. However, my main view
I have a regular old iPhone app that has a main view controller that
I'm working on an iPhone app that has a UITabBar. Occasionally the tab bar
I have an iPhone app with a main view that has a UILabel and
I'm working on a view-based iPhone app that has the following flow: search ->
I have a fullscreen iphone web app that has a startup screen that works.
I have an iPhone app that use UIPickerView and 3 buttons. This picker has
I have an iPhone app with a Core Data object that has a color
I have an ios app that has a target of both iphone and ipad.
I have an iPhone app with a UITabBar, and each tab has a unique

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.