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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:37:48+00:00 2026-05-26T04:37:48+00:00

Before updating my Xcode from 4.1 to 4.2 the following was code was working

  • 0

Before updating my Xcode from 4.1 to 4.2 the following was code was working fine with iOS 4.3, but after upgrading Xcode and test my app on iPhone with iOS 5 it keep crashing on startup!

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window addSubview:tabController.view];
[[tabController.tabBar.items objectAtIndex:0] setTitle:@"Tab1"];
[[tabController.tabBar.items objectAtIndex:1] setTitle:@"Tab2"];
[[tabController.tabBar.items objectAtIndex:2] setTitle:@"Tab3"];
[[tabController.tabBar.items objectAtIndex:3] setTitle:@"Tab4"];
[[tabController.tabBar.items objectAtIndex:4] setTitle:@"Tab5"];
[[tabController.tabBar.items objectAtIndex:5] setTitle:@"Tab6"];
[[tabController.tabBar.items objectAtIndex:6] setTitle:@"Tab7"];
[[tabController.tabBar.items objectAtIndex:7] setTitle:@"Tab8"];
[[tabController.tabBar.items objectAtIndex:8] setTitle:@"Tab9"];
[self.window makeKeyAndVisible];
return YES;
}

It throws the following error:

2011-10-15 15:13:31.238 Mobile[2347:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 5 beyond bounds [0 .. 4]'
*** First throw call stack:
(0x311138bf 0x382b81e5 0x3106b275 0x336b 0x330e57eb 0x330df3bd 0x330ad921 0x330ad3bf 0x330acd2d 0x33c98e13 0x310e7553 0x310e74f5 0x310e6343 0x310694dd 0x310693a5 0x330de457 0x330db743 0x2acd 0x2a28)

If I kept only the first 5 setTitle it will work, but if its more than 5 it will crash!

Please note that I’m creating the UITabBarController in IB not programatically.

  • 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-26T04:37:49+00:00Added an answer on May 26, 2026 at 4:37 am

    Try accessing the viewControllers array on the tabController instead and editing the tabItem on the View Controller directly.

    [[tabController.viewControllers objectAtIndex:0].tabBarItem setTitle:@"Tab1"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having troubles after updating to Xcode 4.2. Before I used the following
(Possible it works as designed, but I'm sure it was working before updating to
Anyone run into this before: After updating DNS records..I do a dig for 'test.somedomain.com'
I'm updating my app to use xCode 4, iOS5 and the latest Facebook SDK.
Before updating my Macbook I used Ruby 1.8.7 and Rails 3.0.9 my app worked
I wanted to test if a key exists in a dictionary before updating the
How can I verify the old password from the database before updating the new
Yesterday before updating the Google App Engine SDK, I was able to do python
I want to backup my existing ASP.net web app before updating it. Therefore I
After updating my Mac to Mac OS X Lion 10.7.3 and XCode to version

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.