Re: NSString initWithFormat and stringWith
Re: NSString initWithFormat and stringWith
- Subject: Re: NSString initWithFormat and stringWith
- From: Andy Lee <email@hidden>
- Date: Thu, 28 May 2009 10:52:41 -0400
On Wednesday, May 27, 2009, at 11:23PM, "Bill Bumgarner" <email@hidden> wrote:
>On May 27, 2009, at 8:20 PM, Andy Lee wrote:
>> I just noticed an earlier message in this thread that points out
>> that stringWithString: does in fact do the same optimization as -
>> copy for constant strings. So the approach in Apple's sample code
>> does not protect from the bundle unloading problem. Aside from the
>> OTHER_CFLAGS approach Jesper describes, the only solution I can
>> think of is to use [NSMutableString stringWithString:] instead of
>> [NSString stringWithString:].
>>
>> But of course this is an odd case, and the vast majority of the time
>> it's just wasted code to say stringWithString:@"abc".
>
>If you find something that is causing a bundle with Objective-C code
>to be unloaded, please file a bug via http://bugreport.apple.com/.
>
>It isn't supported and the number of edge cases are both vast and
>subtle to the point of "it just does not work, don't do it.".
>
>(And it really won't work with GC turned on)
Oh yeah, right -- you've stressed this before.
--Andy
_______________________________________________
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