On 26 May 2015, at 19:24, Alex Zavatone <z...@mac.com> wrote:
> For any nonmutable class, should I be using copy instead of strong or is this 
> just with NSString?

 You should consider that pattern for every class for which a mutable version 
exists that is a subclass of the non-mutable base class (because only in that 
case could someone assign a mutable object to your un-mutable property), and 
which implements NSCopying. For Foundation and other Apple classes that 
considering should lead to using copy.

 For other frameworks you should probably look at their code to make sure they 
work the same way as Apple's. If they don’t use the retain optimization, you’ll 
want to verify that it performs within your constraints (by profiling) and if 
they don’t, maybe add this optimization.

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to