tags:

views:

70

answers:

2

I have a navigation based application which has multiple views (Say root <- A <- B <- C). What I want to do is that when users pop out of the top most view (C) to view B, automatically execute some checks in view B and if met, go to view A.

What I did is the following:

In class B which is a UITableViewController

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    BOOL completed = NO;

    // The logic that sets completed is here

    if (completed)
    {
        // OK I want to pop out to the previous view controller (A)
        [self.navigationController popViewControllerAnimated:YES];
    }
}

}

What happens is that the debug stops telling me that navigationController has already been deallocated. Not so sure why

Any ideas?

A: 

Assuming all of your properties are (nonatomic, retain) Then you must be calling release somewhere, perhaps in your view switching routine?

DevDevDev
A: 

All my properties are (nonatomic, retain) but self.navigationController comes from the superclass. It is not in my class.

pfs