Noob question:
I'm currently under the impression that when you want to create an object, you need to alloc
and init
that object.
However, I've seen seen several sample codes where an NSString
object is declared, yet I see no alloc
or init
messages following...
A very simple example:
NSString *myString = @"Hello World";
NSLog(@"%@" , myString);
Can someone explain why this is so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…