Reference count is still 1 after [obj release], when it should be deallocated
When I create an object and check its retain count, I get 1 as expected. When I release the object and then check the retain count again, it is still 1. Shouldn't the object be deallocated, and the retain count 0? NSMutableString *str=[[NSMutableString alloc] initWithString:@"hello"]; NSLog(@"reference count is %i",[str retainCount]); [str release]; NSLog(@"reference count is %i",[str retainCount]); I do see 0 for the retain count if I set str to nil first. Why is that? Don't use retainCount , it doesn't do what you expect in most cases. Your second NSLog is accessing deallocated memory as an