On Apr 21, 2014, at 8:27 AM, Dave <d...@looktowindward.com> wrote:
> Also, when I did this, I left the property attributes as “retain” and 
> “assign”, I’m wondering if it would be better to change them to “strong” and 
> “weak” ? Although, AFAIK this shouldn’t make a difference?

For object properties, "strong" is a synonym for "retain", but "assign" is 
different from "weak".  Weak properties are automatically set to nil when the 
object they reference goes away.  If you use "assign" for an object property, 
it will not be automatically nil'ed and you may end up with a garbage pointer.

"weak" is not supported in 10.6 or 10.7, I forget which.  If you need to 
support an OS version that supports ARC but not "weak", you should use the 
qualifier "unsafe_unretained" rather than "assign".  It behaves the same, but 
it expresses intention better, plus you can later do a global replace to use 
"weak" when you decide to drop support for that old OS.  In this case it's up 
to you to nil out that object property at the appropriate time.

--Andy





_______________________________________________

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