オブジェクトを作成してその保持カウントを確認すると、期待どおりに1が得られます。オブジェクトを解放して、保持カウントを再度確認すると、まだ1です。オブジェクトの割り当てを解除して、保持カウントを0にする必要がありますか?
NSMutableString *str=[[NSMutableString alloc] initWithString:@"hello"];
NSLog(@"reference count is %i",[str retainCount]);
[str release];
NSLog(@"reference count is %i",[str retainCount]);
最初に設定した場合、保持カウントに0が表示されます。何故ですか?str
nil