if I create an nsmutablestring and then release it , shouldn’t the retain count be 0?
my retain count stays 1.
NSMutableString *text = [[NSMutableString alloc]init];
[text release];
NSLog(@"retain count %d ", [text retainCount]);
Am I missing something ?
thanks.
There’s no guarantee that
retainCountwill return the correct value at any point during the object’s lifecycle. If you’ve created anNSMutableStringusing[[NSMutableString alloc] init]and you’re calling release on it once, you’re doing the right thing and shouldn’t worry about it.