I've read different answers about adding tabbar icons both in the app delegate and in the interface builder.I want to add them in my firtsviewcontroller, because I wanted to read the icon image name from the plist
.
It is suggested to do like this:
NSArray *viewControllerArray = nil;
viewController1 = <View Init Code>
viewController2 = <View Init Code>
viewController3 = <View Init Code>
1stNavController = [[UINavigationController alloc] initWithRootViewController:viewController1];
UIImage *img = [UIImage imageNamed:@"tab_home"];
[1stNavController .tabBarItem initWithTitle:@"Home" image:img tag:1];
But I don't like to do it in this way, because I think that is not clean. I would like to do something similar to the following, but I dont know why it is not working:
[[self.tabBarController.tabBar.items objectAtIndex:2] setIcon:[UIImage imageNamed:....]];
Any solution?