KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given this code: // Initialize string NSString *name = @"Franzi"; @"" macro creates a NSString with given text (here the name Franzi) and a RETAIN COUNT OF 1? So @"" gives an NSString with have to be released or not? Am I responsible for this object? Second code example then confuses me, even though I am using it that way: NSSting *message; message = [NSString stringWithFormat:@"Hello @%!",name]; //message = [NSString stringWithFormat:@"Hello Girl!"]; So message gets released in next run loop, k. But what is with the NSString given as argument for stringWithFormat? Does the class object NSString release the NSString @"Hello %@"/@"Hello Girl" given as arguement? Or does @""-Konstruktor only give back autoreleased NSStrings?
Tags (comma-separated)
Save Edits
Cancel