我可以在同一个类的实例方法中释放 ivar 吗?因为我想再次分配初始化它。这与其他[_myNSStringIvar release];
的冲突-(void)dealloc
吗?
// in the middle of an instance method
if(_myNSStringIvar != nil){
[_myNSStringIvar release];
}
_myNSStringIvar = [[NSString alloc] initWithString:(NSString *)[aDictionary objectForKey:@"key"]];