views:

87

answers:

1

I have a viewController that presents a modalViewController when a UINavigationBarItem is touched. After the user is done with the modal view, the modalViewController is dismissed. At this point I want to change/remove the NavigationBarItem -- how would I accomplish this?

I was thinking of using viewWillAppear: but I only want the change to happen when the modalViewController is dismissed.

+1  A: 

One way is to use NSNotificationCenter.

Before presenting the modal view, call addObserver to prepare to be notified.
At the place where the modal view is dismissed, post a notification using postNotificationName.

The notification will call a method you specify in addObserver.
In this method, put your "modal view dismissed" logic.

DyingCactus