Re: There's obviously something I don't understand about autorelease.
Re: There's obviously something I don't understand about autorelease.
- Subject: Re: There's obviously something I don't understand about autorelease.
- From: Quincey Morris <email@hidden>
- Date: Mon, 19 Mar 2012 13:08:18 -0700
On Mar 19, 2012, at 11:48 , Matt Neuburg wrote:
> As long as we're just dreaming up our own linguistic world, I'd suggest that instead of "owning" we say "owning-copying". I've never liked the way "copy" implies "retain". The word "retain" tells you something very important, namely that this thing has an elevated retain count and needs release later. It's not very nice to expect a beginner to know that "copy" *also* means that. If you're copying, you're taking ownership, and "owning-copying" would remind you of that. m.
"you" == "the class implementor"??
Because I don't think the *client* cares about the ownership of the copy that's made.
You're also pointing out a larger area of secondary difficulty: the attributes on the @property declaration don't ensure that they're honored by the implementation. I have to confess I write non-atomic setters all the time, but I never bother to declare the @property as nonatomic. That's at least in part because I almost never rely on atomicity at the property level, in code I write or frameworks I use, so I don't have to believe the declaration regarding that attribute anyway.
Similarly, when writing a setter for a "copy" property, I'd say it's sometimes harder to remember to do the copy at all, than to remember the correct memory management.
_______________________________________________
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