UITabViewItem, 2 questions


Hi all,

I just finished the ch 7 challenge and two questions came up for me.

First, I noticed that the tabBar images are not retina quality on my iPod. However, the tabBar images of the standard clock program are. Any way to specify both retina and standard images?

(Edit: This is answered in the “for the more curious” section of chapter 8)

Second, while trying to answer my first question, I found the documentation for the UITabBarItem class has no properties for title or image and is itself a direct subclass of NSObject. Looking at the header file UITabBarItem.h confirms that the documentation is correct. So how does our code work?

For example p 139: [tbi setTitle:@“Time”];

UITabBarItem has private variable _time, but no method setTime or @property time. What’s going on?

Hoping for enlightenment,


The second part of your question sounds muddled. Not sure if I understand what you are asking, but I’ll have a go:

[tbi setTitle:@“Time”]

Here we are setting the title of tbi to “Time”

@“Time” is an NSString.


Sorry for the muddled question. I was asking more about the documentation of UITabBarItem, because I didn’t see properties for title and image, and thought UITabBarItem inherited directly from NSObject. Looking at it again, I see UITabBarItem inherits from UIBarItem, which has name and image properties (and more).

So the answer I was looking for is “setName” is defined for instances UITabBarItem because name is a property of the superclass UIBarItem.