UITabBar items


#1

Hello,

At a point, the book asks you to create a title and an image to be displayed on the tabBarControllers tabBar. Seemingly, you create these on the specific view controller. So each view controller must have a property of a UILabel to hold a title, and same goes for the uIIMage, right? So the UITabBarController is accessing these properties to display on the tabBar the minute they are added to the ViewControllers array property of the tab bar controller, right?

Sorry if it sounds messy, just making sure i got it.


#2

I have the exact same problems with that passage.

I dont understand how UITabBarItem *tbi = [self tabBarItem] can hold the reference, because after the method initWithNibName … is called this pointer disappears because its removed from the stack. There is no message like [self setTitleForTabs:@"title"] which could set a property in the inherited from its “super” Classes.

so how does the UITabBarController instance gets the title ??

EDIT: AH I UNDERSTAND.

we need *tbi just for calling the method setTitle on self.
self has this property tabBarItem, and if its set then we dont need the pointer anymore …

Sorry ! (Its already (a bit) late here in Germany)