Re: Appropriateness of assign attribute and -fobj-gc-only
Re: Appropriateness of assign attribute and -fobj-gc-only
- Subject: Re: Appropriateness of assign attribute and -fobj-gc-only
- From: Rick Mann <email@hidden>
- Date: Sun, 21 Sep 2008 18:08:49 -0700
On Sep 21, 2008, at 15:22:22, Quincey Morris wrote:
On Sep 21, 2008, at 15:00, Quincey Morris wrote:
So, is it really inappropriate? It seems very appropriate to
assign the pointer rather than allocate a new object and copy it,
especially for immutable objects.
No, it's not.
Sorry, just to clarify -- no, it's not really inappropriate. Yes,
it's very appropriate to assign the pointer sometimes.
I was going to say...especially for immutable objects like NSString
and NSNumber, which you pointed out are almost always used as
attributes and not as relationships, it seems to make more sense (from
a performance standpoint, at least) to just assign the pointer and not
allocate a new object and copy the contents.
On Sep 21, 2008, at 15:02:08, Michael Ash wrote:
Use "retain", as it implies the correct
strong reference semantics, but when running under GC will generate a
straight-assignment setter.
If that's the case, then I think it makes sense to specify "retain" in
all those instances. I didn't like "retain" because, well, it implied
that a retain count was going up, despite the fact that I'm in a GC-
only app.
Thanks!
--
Rick
_______________________________________________
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