I want to create an object in Objective C but I don\'t hold a reference to it.
Is it allowed to let the object control its own lifetime by calling [self release]?>
And I will use [self autorelease] instead of [self release]. Because usually it's called in
- (void)aMethod
{
[self.delegate aDelegateMethod:self];
[self release];
//If you add code related to self here, after [self release], you are making a huge mistake.
}
If I use [self autorelease], I can still do something after autorelease.