From: Panayotis K. <pan...@pa...> - 2010-03-11 13:20:33
|
I've seen that in the code produced by xmlvm, every time an object is returned, this object is at the same moment released. Thus usually in properties we see something like: return [[self propertyname] retain]; So, can we say that this is a general rule? I mean, that in any case, no matter what, when the thin library obj-c layer is required to return an object, this object should be *always* retained? Is this valid also for objects like usually retrieved with selectors like [UIFont systemFontOfSize:fontsize] ? I have made some tests with the last one, and even if I don't retain it, there is no segfault (which, ok, this doesn't mean anything). So what is optimum (concerning memory management) ? Thank you! |