I've got a "drill down" app where table views are displayed with a navigation controller. I want my data object to do some things when the user presses the Back button. So I made the data object the delegate of the navigation bar, and added this method to it:

        - (void)navigationBar:(UINavigationBar *)navigationBar
                           didPopItem:(UINavigationItem *)item
        {
                [self restorePreviousArray];
                
        }

As the docs indicate, once I set a delegate for the navigation bar, the previous view is no longer restored when the Back button is pressed. But I can't see how to restore this view in the delegate method. I'm reading the View Controller Programming Guide section on navigation controllers, but the answer hasn't leapt at me yet.

Is this the best way to react to the Back button being pressed? If so, how do I restore the previous view? If not, how should I do it?

dkj
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to