nscopying - Is it better to use -> instead of . in to implement `copyWithZone:` method in objective-c? -
say there's class property p1, , setter p1 has been overwritten. want implement nscopying protocol class a.
in understanding since you're "copying" instance of class a, there's no need trigger setter methods in copywithzone: method. copyofinstance -> _p1 = _p1; better copyofinstance.p1 = _p1. right?
yes. forming new object if implementing initializer. rules same. must not use setter method in init... method, must not use setter in copywithzone:.
Comments
Post a Comment