iPhone instantiating a UITabBarItem programmatically
- by William Jockusch
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.