我遇到了一些不熟悉的Objective-c內存管理代碼。是什麼區別:Objective-c對象釋放模式
// no property declared for myMemberVariable in interface
id oldID = myMemberVariable;
myMemberVariable = [MyMemberVariable alloc] init];
[oldID release];
和:
// (nonatomic, retain) property is declared for myMemberVariable in interface
self.myMemberVariable = [[MyMemberVariable alloc] init];
謝謝!