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)

b.bum

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to