iphone - navigationItem.backBarButtonItem not working? Why is the previous menu still showing as the button? -
trying customize button in drilldown navigation controller.
on 1 view controller have add button code programatically generates new uiviewcontroller
:
- (void)add:(id)sender { myaddviewcontroller *addcontroller = [[myaddviewcontroller alloc] initwithnibname:@"myaddviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:addcontroller animated:yes]; [addcontroller release]; }
this works , when click add button drills down new view. inside viewdidload
method of myaddviewcontroller.m
have:
self.navigationitem.backbarbuttonitem = [[[uibarbuttonitem alloc] initwithtitle:@"back" style:uibarbuttonitemstyleplain target:nil action:nil] autorelease];
but isn't working. button in navigation controller remains title of previous view's controller on stack. seems line nothing. did miss something?
thanks
this work on each child after viewcontroller has self.navigationitem.backbarbuttonitem
.
Comments
Post a Comment