R – Defining String Literals?

memorymemory-managementnsstring

Possible Duplicate:
What's the difference between a string constant and a string literal?

Can anyone confirm this for me …

NSString *testString = @"Betty";

By my way of thinking this line is declaring the NSString pointer (*testString) to point to the string literal @"Betty". This declaration does not need an alloc, nor does it need to be released? I just want to make sure I am on the right track.

-gary-

Best Answer

You are on the right track. The string literal will be compiled to a immutable instance of NSString.

See this question for more details.