CodeSmile
CodeSmile

Reputation: 64477

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?

Upvotes: 6

Views: 372

Answers (1)

Lily Ballard
Lily Ballard

Reputation: 185681

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

Upvotes: 9

Related Questions