Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Jul 1, 2008, 12:15 AM   #1
macrumors newbie
Join Date: Jul 2008
iPhone SDK help: UITabBarController

I've been having a problem with the iPhone SDK, specifically with the UITabBarController class. Whenever I try to implement a simple two-item TabBarController programmatically, it won't work.

I've found, through some simple debugging, that whenever I assign an array of view controllers to the TabBarController's viewControllers property, the array is actually assigned to the customizableViewControllers property. I cannot, for the life of me, figure out why this is.

I realize that I could just use interface builder, but I prefer to do it programmatically. If anyone has the answer to this question, I will be eternally grateful.


Last edited by ari.ehrmann; Jul 3, 2008 at 02:15 PM. Reason: Misused Language
ari.ehrmann is offline   0 Reply With Quote
Old Jul 7, 2008, 06:35 PM   #2
macrumors newbie
Join Date: Jul 2008

I had the same problem - programmatically creating a UITabBarController did not work the way the Apple documentation described. I found the answer on the Apple developer forum (

Instead of doing:

tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
do just:

tabBarController = [[UITabBarController alloc] init];
Hope this helps.
dredmuns is offline   0 Reply With Quote
Old Jul 8, 2008, 12:10 AM   #3
Thread Starter
macrumors newbie
Join Date: Jul 2008

Thank you so much, dredmuns. I feel really dumb, but I just didn't think of doing that. I hope that documentation gets fixed. It was really aggravating getting errors doing exactly what Apple said to do. But I really appreciate the help. Thanks for responding.
ari.ehrmann is offline   0 Reply With Quote
Old Jul 13, 2008, 08:29 AM   #4
macrumors 65816
louden's Avatar
Join Date: Dec 2003
Location: Seattle
In general, Apple preaches the best practice is to leverage Interface Builder as much as possible (and I agree with that). Unfortunately, Interface Builder wasn't really ready when they built most of their samples... So many of the samples don't use Interface Builder consistently.

I'll predict that getting over that stumbling block (of which I stumbled) will also cause quite a bit of frustration to new iPhone Developers. This post is a perfect example! (Loading a View with a Nib or not)

Dell Pentium 2 with 500 MB HD Windows 95
Compaq iPaq w/ 64MB of Ram
louden is offline   0 Reply With Quote
Old Jul 14, 2008, 07:27 PM   #5
macrumors newbie
Join Date: Jul 2008
Interface Builder is not better

Are there any fully programmatic or interface builder examples of a tab bar controller implementation. I'd love to see one as a reference that actually works with buttons on each view that link back to something.

I'm afraid I've tried to do things the interface builder way and I get stuck right when I think I've got it.

I can do all of the appropriate view rendering and switching of views but when I try to link IBOutlets or IBActions back to a controller my test app crashes trying to call the super class.
Hazmit is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
A problem loading from a local XML in UITabBarController micharadi iPhone/iPad Programming 0 Nov 14, 2011 05:19 AM
Do you need to know programming to make a informational app for the iPhone? cootersgarage6 Mac Basics and Help 1 Jan 28, 2011 08:44 PM
What is the easiest language to program in for iPhone apps? cootersgarage6 iPhone and iPod touch Apps 1 Jan 28, 2011 03:40 PM
How hard is making an app on Iphone SDK? cootersgarage6 iPhone/iPad Programming 4 Dec 24, 2010 12:54 PM
help please...i install the iphone sdk package I can't find IPhone SDK tools kuanhsuh iPhone/iPad Programming 2 Dec 25, 2008 08:09 PM

All times are GMT -5. The time now is 10:05 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC