I have a tabBarController set up in the AppDelegate and have a few UIViewControllers with Nav Controllers. In one of the TabBar items, after I have pushed a few UIViews I want to update the badgeValue item of a different TabBar item.
Whats the best way to do this? The only way I can really think is a NSNotification and a singleton storage for the value, but it seems a lot of work for something simple, that and I have no idea about NSNotifications.
I had a wild guess at something like super.tabBarController.otherView.tabBarItem.badgeValue = @"1" (as I set which tab is selected in a similar way) but I'm not surprised this doesn't work.
Thanks
UITabBarController
though the window singleton, the accepted answer is accessing it through the parent of the current controller. Yours will work if theUITabBarController
is the root view controller on the window, if not it will probably crash. The accepted answer will work from the direct child, but will get messy if you're trying to update from a controller a few layers deep. – Cushy