iPhone instantiating a UITabBarItem programmatically

Posted by William Jockusch on Stack Overflow See other posts from Stack Overflow or by William Jockusch
Published on 2010-04-21T14:39:28Z Indexed on 2010/04/21 14:43 UTC
Read the original article Hit count: 692

Filed under:
|

Try as I might, I cannot get this to work. Here is my latest attempt. Can someone clue me in as to why this does not work?

In a method which is called by my view controller's init method:

UIImage *image = [UIImage imageNamed: @"window22.png"];
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle: @"Some Title" image: image tag: 0];
self.tabBarItem = item;

All it does is put a big square where the image should be. The title in the tab bar remains the same as the view controller's title.

Everything is being instantiated programmatically here, including the tab bar controller.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitabbaritem