Releasing retained objects inside dealloc When releasing objects that might have been retained during the app's lifetime, how do you check if the object really exists and prevent releasing a nil object?

Here's how I'm doing it:

- (void)dealloc{
    if(account_)
        [account_ release];
    account_ = nil;
    [super dealloc];
}
- (void)dealloc{
    if(account_)


You don't need to do this. Objective-C ignores attempts to call methods on nil objects. So you call release and nothing will happen if its already nil

        [account_ release];
    account_ = nil;


Your object is being destroyed, there isn't a whole lot of point in setting values to nil

    [super dealloc];
}