NSArray, NSDictionary property attribute issue, retain or copy?
NSArray, NSDictionary property attribute issue, retain or copy?
- Subject: NSArray, NSDictionary property attribute issue, retain or copy?
- From: ico <email@hidden>
- Date: Sun, 13 Nov 2011 16:48:00 +0800
Hi all,
We always use copy attribute on the NSString property declaration because
it will figure it out that when you pass a mutable copy, if will copy then
make the object to be immutable version and assign it to your property, and
it will retain if you pass an immutable version.
That's very cool and is the most often situation we want.
However, I really hard to see people use the same technique on NSArray and
NSDictionary.
If the reason for NSString holds true, why not we also use copy on NSArray
and NSDictionary property declaration?
I see most of time, developer just use retain attribute on them.
why?
--
==========================
Life isn't about finding yourself.
Life is about creating yourself.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden