I'm reading memory management rules to this point where it said
- (void)printHello {
NSString *string;
string = [[NSString alloc] initWithString:@"Hello"];
NSLog(@"%@", string);
[string release];
}
you have ownership and have to release string
, but I'm curious about the @"Hello"
. @" "
is the syntax for creating and NSString
, and it's an object. So doesn't that get leaked?