Re: Memory allocation issues with NSObject and NSString
Re: Memory allocation issues with NSObject and NSString
- Subject: Re: Memory allocation issues with NSObject and NSString
- From: Bill Bumgarner <email@hidden>
- Date: Sun, 18 Jan 2009 20:59:22 -0800
On Jan 18, 2009, at 8:52 PM, Chris Suter wrote:
Are you sure about that? My understanding is that the second case ends
up pointing to a constant string and that retain and release are also
no-ops in that case.
Yah... but that is even more of an implementation detail than the
first and *not* -release'ing something that you +alloc/-init'd would
be asking for trouble.
Pick a pattern. Stick with it. Everywhere. Always.
Until there is a damned good reason not to.
Also, if I remember rightly, that in the first case you'll end up
pointing to a constant in the current translation unit, whereas in the
second case you end up pointing to a global constant defined in
CoreFoundation. Implementation details, I know.
Way too much of an implementation detail for me. I have code to write!
Seriously -- I don't know off hand. I could go read the source and
figure it out, but my general conclusion is that if I have to answer
that particular question, I'm doing something terribly wrong.
b.bum
_______________________________________________
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