I’ve two ViewController from first i’ve added two bar buttons to second ViewController. code here- `
self.navigationItem.leftBarButtonItem =
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self
action:@selector(backBtnAction)] autorelease];
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:callListViewCtrObj
action:@selector(saveListNameAction)] autorelease];
self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor];`
Now i want to remove these two buttons when done button clicked(i.e. saveListNameAction of callListViewCtrObj is called, see the code above), i’ve tried like this- homeViewCtrObj.navigationItem.leftBarButtonItem = nil;
homeViewCtrObj.navigationItem.rightBarButtonItem =nil;
where homeViewCtrObj is object of first view controller.
Any suggestion or sample code will be appreciated.
Thanks.
In CallListViewCtr create a property for HomeViewCtr
Now when you push this view makes sure to assign the newly created viewController to this property.
Now you can use
I think you’ll want to set homeView to nil when your done.