0
我從viewDidLoad調用createTableData。我不明白的是我正在做一個NSMutableDictionary的分配,但我不明白爲什麼這個對象沒有從內存中釋放 - 儘管釋放。 我確實看到了內存泄漏,泄漏似乎指向了這部分代碼。 有人可以指向我可以讀/理解我應該做什麼與我正在做什麼的網址嗎?我似乎無法看到我在這裏出了什麼問題。如何dealloc NSMutableDictionary
- (void)createTableData {
NSMutableArray *toolList;
toolList=[[NSMutableArray alloc] init];
[toolList addObject:[[NSMutableDictionary alloc]
initWithObjectsAndKeys:@"Some title",@"name",
@"1",@"whatViewController",
@"",@"url",
@"some_icon.jpg",@"picture",
@"some detail text",@"detailText",nil]];
toolData=[[NSMutableArray alloc] initWithObjects:toolList,nil];
[toolList release];
}
- (void)dealloc {
[toolData release];
[super dealloc];
}
哇...感謝您的非常快的響應! – uncivilized 2010-11-09 14:58:16
我也發現這篇文章基本上解釋了你提供的內容:http://www.memo.tv/memory_management_with_objective_c_cocoa_iphone – uncivilized 2010-11-09 14:58:40