objective c - XCode Analyzer Warnings Without Details / Line Numbers -
i ran analyzer , found handful of warnings can't associate lines in code. i'm not sure how handle them. clicking on them brings me right file in editor, analyzer summary results tell me much. don't know each of these referring to, , going through code line-by-line not productive (i don't know i'm looking for).
object +0 retain counts returned caller +1 (owning) retain count expected incorrect decrement of reference count of object not owned @ point caller object +0 retain counts returned caller +1 (owning) retain count expected object sent -autorelease many times
for last warning, removed autorelease, , went away, don't know how release it, since it's used in return statement.
- (client*) createnewclient { ... client *client = [nsentitydescription insertnewobjectforentityforname:@"client"inmanagedobjectcontext:datainterface.managedobjectcontext]; ... return client; }
what do these, in general?
as not owning object returned insertnewobjectforentityforname:
, not have release it.
from apple memory management programming guide:
you take ownership of object if create using method name begins “alloc”, “new”, “copy”, or “mutablecopy” (for example, alloc, newobject, or mutablecopy), or if send retain message.
insertnewobjectforentityforname:
contains 'new', not begin it.
Comments
Post a Comment