I think this is normal. Maybe your code was changed / refactored before the update ?
TabBarItem
is defined in UIViewController
and represent the tab bar item of this view controller.
So this.TabBarItem
is the tab bar item of this this view controller, e.g. I used a UITabBarController
in my code (let's call it parent
).
this.TabBarController.TabBar.Items[x]
would represent the tab bar item of one of the child view controller of this parent
.
So when I create child1
and child2
(both instances of UIViewController
) and assign them to parent.ViewControllers
we get three instances of UITabBarItem
(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
2012-09-14 20:13:24.092 test1[47917:1507] parent.TabBarItem.Handle = 291086496
2012-09-14 20:13:24.094 test1[47917:1507] parent.TabBar.Items [0].Handle = 218412640
2012-09-14 20:13:24.094 test1[47917:1507] parent.TabBar.Items [1].Handle = 160885040
2012-09-14 20:13:24.095 test1[47917:1507] child1.TabBarItem.Handle = 218412640
2012-09-14 20:13:24.096 test1[47917:1507] child2.TabBarItem.Handle = 160885040
So I can either do:
child1.TabBarItem.BadgeValue = "5"; // or
parent.TabBar.Items[0].BadValue = "5";
to get the same behaviour. However changing the parent.TabBarItem
won't be visible anywhere (at least not in my case where this is the RootViewController
of my test application).