我正在阅读它所说的内存管理规则
- (void)printHello {
NSString *string;
string = [[NSString alloc] initWithString:@"Hello"];
NSLog(@"%@", string);
[string release];
}
Run Code Online (Sandbox Code Playgroud)
你有所有权并且必须释放string
,但我很好奇@"Hello"
.@" "
是创建和的语法NSString
,它是一个对象.那不是泄露了吗?