Using MonoTouch 5.4 on new XCode and iOS 6.0
Old ViewController In TabBarController code:
this.TabBarItem.BadgeValue = "5";
No longer works.
New code, changing to this does work:
this.TabBarController.TabBar.Items[theIndexOfTab].BadgeValue = "5";
By not work I mean the badge does not appear, the value is just ignored in the old case.
I think this is normal. Maybe your code was changed / refactored before the update ?
TabBarItemis defined inUIViewControllerand represent the tab bar item of this view controller.So
this.TabBarItemis the tab bar item of this this view controller, e.g. I used aUITabBarControllerin my code (let’s call itparent).this.TabBarController.TabBar.Items[x]would represent the tab bar item of one of the child view controller of thisparent.So when I create
child1andchild2(both instances ofUIViewController) and assign them toparent.ViewControllerswe get three instances ofUITabBarItem(one for parent, one for each child) – but only two of them (the children will ever be visible).E.g. from logging the handle values
So I can either do:
to get the same behaviour. However changing the
parent.TabBarItemwon’t be visible anywhere (at least not in my case where this is theRootViewControllerof my test application).