this tutorial is great, but I'm still a bit confused about autorelease stuff:
In this example:
Code:
-(void)doSomething
{
SomeObject *obj = [[[SomeObject alloc] init] autorelease];
self.obj = obj;
}
When does autorelease get called on *obj value? After doSomething method ends or in the current class dealloc?
Then again, in this code:
Code:
-(void) logValue:(int)intValue
{
NSLog(@"%@", [NSString stringWithFormat:@"%d", intValue]);
}
When does stringWithFormat value get destroyed? After logValue ends or somewhere after current class dealloc?