objective c - using ARC and not caring about manual memory mgmt anymore -
when 1 uses arc, means can forget memory management related tasks right? e.g., deletion/release of memory allocated etc.
two places know may need interfere retain cycles, , 1 should use __weak before outlet ivars in class definitions (if these outlets not top objects in object hierarchy of xib).
is there else have consider?
things have changed. should still stick pattern related memory managment / arc. won't retain, release, autorelease , dealloc more.
new: still overwrite dealloc method , nil strong references. not required can done. not call [super dealloc] more.
you declare properties strong or weak depending on whether take ownership or not.
if want rid of object in way memory freed up, have nil strong references object. each strong reference corresponds 1 retain. cannot call retain on objects.
you cannot call undeclared methods more (without arc generate compiler warning, arc error.) warnings when using variable selectos (that using variables of sel type , perform on objects) , should never methods might have implact on retain count (such alloc).
and still have plenty of chances of making errors when interface areas of framework not arc, such core functions.
so far away "forget about" applying arc patterns less work , less error prone former mrc patterns.
Comments
Post a Comment