在我@interface
孤單一NSArray *Monate
依次爲:Objective-C:是一個自動釋放的初始化,然後在構造函數中保留錯誤嗎?
@property (nonatomic, retain) NSArray* Monate;
如果我這樣做:
filePath = [[NSBundle mainBundle] pathForResource:@"SomeFile" ofType:@"plist"];
self.Monate = [NSArray arrayWithContentsOfFile:filePath];
在構造
,它被設置爲自動釋放的對象(是正確的?)。 因此,我應該做一個[Monate retain]
事後?
另一個注意事項:不要大寫ivars的名稱。 Obj-C約定是大寫的名字用於類。 – NSResponder 2009-09-16 23:55:32