string or nsstring with string

Posted by joels on Stack Overflow See other posts from Stack Overflow or by joels
Published on 2010-04-07T16:39:35Z Indexed on 2010/04/07 16:43 UTC
Read the original article Hit count: 184

Filed under:
|

Lets assume myProp is @property (retain) NSString * myProp and synthesized for us....

self.myProp = @"some value";//string literal?

self.myProp = [NSString stringWithString:@"some value"];

Is there a difference here? Is the first one a string literal that doesnt get autoreleased or is it just in memory for it's current scope and I dont have to worry about it?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about nsstring