wow, thanks a lot, it's more clear
So I guess it will be like this:
Code:
-(void)doSomething
{
SomeObject *obj = [[[SomeObject alloc] init] autorelease]; // count 1
self.obj = obj; // count becomes 2
//( can put some additional code here)
} // count back to 1
and in second case:
Code:
-(void) logValue:(int)intValue
{
NSLog(@"%@", [NSString stringWithFormat:@"%d", intValue]); // count 1
// (some additional code)
// value is still there somewhere with count 1
} // count becomes 0, value destroyed
is it correct?