tags:

views:

12

answers:

0
NSString *string = @"hello";

1) I keep reading that constant NSString does not get released, but this Apple page mentions:

the compiler makes such object constants unique on a per-module basis, and they’re never deallocated, though you can retain and release them as you do any other object.

http://developer.apple.com/mac/library/documentation/cocoa/conceptual/strings/Articles/CreatingStrings.html

2) If constant NSString does not get released, would it cause memory problems if used extensively? For example, is this a problem if repeated thousands of times:

NSString *string = @"One";
...
string = @"two";
...
string = @"three";
...

what's a good alternative?