Re: "Constant" strings are static or autoreleased?
Re: "Constant" strings are static or autoreleased?
- Subject: Re: "Constant" strings are static or autoreleased?
- From: Lance Bland <email@hidden>
- Date: Wed, 5 Mar 2003 15:50:26 -0500
On Wednesday, March 5, 2003, at 02:51 PM, zauhar wrote:
>
>True. Those are static strings created for you when the program
>
launches. They can never be released or modified.
>
>
Which is it? I would think that David's answer is correct.
This:
NSString *aString = @"ddd";
NSLog(@"[aString retainCount]: %u", [aString retainCount]);
[aString release];
NSLog(@"[aString retainCount]: %u", [aString retainCount]);
Gives this:
2003-03-05 15:41:47.248 xx[1220] [aString retainCount]: 4294967295
2003-03-05 15:41:47.263 xx[1220] [aString retainCount]: 4294967295
Indicating that the "designers" wanted @"" to be constant. It may be
documented in a html file somewhere. The original obj-c specs never had
@"" as a syntax (or feature) TMHK.
-lance
------------------------------------
Lance Bland
mailto:email@hidden
VVI Is The #1 Visual-Report Tool Developer For Mac OS X
http://www.vvi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.