i am just wondering if we can do so:
SBJsonParser *parser = [[SBJsonParser alloc] init];
id repr = [parser objectWithString:self];
return repr;
[parser release];
So releasing object after returning it, is this a good practice? thanx for any information 🙂
Simple answer: NO
You can not execute anything after a
returnstatement.Instead you should
autoreleasethe object. That will deallocate it within the next cleanup run of the surrounding AutoreleasePool.