Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ObjC ARC: does a weak property's setter method run when the object is set to nil by ARC?

Really quick question (I could test it myself but not on a computer with Xcode):

If ARC sets a weak property to nil, will the property's setter run with the parameter being nil, or is the property setter bypassed in this case?

like image 556
LearnCocos2D Avatar asked May 02 '13 20:05

LearnCocos2D


1 Answers

No. ARC doesn't set properties to nil. It will set the backing ivar to nil, but that doesn't run your setter.

like image 97
Lily Ballard Avatar answered Sep 19 '22 19:09

Lily Ballard