NSString *notAllocatedString = @"This string was not allocated.";
NSString *allocatedString = [[NSString alloc] initWithFormat:@"This string was allocated."];
NSLog(@"%@", notAllocatedString);
NSLog(@"%@", allocatedString);
這兩個字符串都打印得非常好。兩者的區別究竟是什麼?我的意思是,我知道一段內存分配給第二個,應該被釋放,但除此之外 - 每個內存的優點和缺點是什麼?初學者Objective-C NSString問題