objective c - iPhone, how I hide a tab bar button? -


how hide individual tab bar button ?

i've searched , not found anything, full bar.

i've made progress still having problems, code in app delegate outlet tab bar, i'm calling within viewdidload of first view shown in tab bar.

-(void)hidetabbutton {   nsmutablearray *aitems = [[roottabbar items] mutablecopy]; (uitabbaritem *tabbutton in aitems) {     if ([tabbutton.title isequaltostring:@"first"]) {                    [aitems removeobject:tabbutton];         break;     } } [roottabbar setitems:aitems animated:yes]; [aitems release];    } 

but gives me error, seem possible otherwise why have setitems.

 terminating app due uncaught exception 'nsinternalinconsistencyexception',  reason: 'directly modifying tab bar managed tab bar controller  not allowed.' call stack @ first throw: 

heres full code, think i'm close. my sample project

you need use setitems:animated: this. create array of buttons want keep on uitabbar , pass instance method:

[mytabbar setitems:itemstokeep animated:true]; 

reference: http://developer.apple.com/library/ios/#documentation/uikit/reference/uitabbar_class/reference/reference.html


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -