I found this strange thing. XCode instruments tell me that this line
return (SDZPerson*)[[[SDZPerson alloc] initWithNode: node] autorelease];
leaks. But if i change it to:
SDZPerson* person = [[[SDZPerson alloc] initWithNode: node] autorelease];
return person;
Instruments no longer report leak in this place. Is it really a leak or is it nothing?
Thank you all in advance.
Even if the two code snippets are slightly different (the 1st one contain a typecasting), I doubt the instruments indicate this as a leak due to the autorelease in the return statement.
Adding autorelease in the return statement can be used.
You should give it a try to
or even