我从 viewDidLoad 调用 createTableData。我不明白的是我正在为 NSMutableDictionary 做一个分配,但我不明白为什么该对象没有从内存中释放——尽管释放了。我确实看到了内存泄漏,并且 Leaks 似乎指向这部分代码。有人可以指向我可能能够阅读/理解我应该做什么和我正在做什么的网址吗?我似乎看不出我在哪里出错了。
- (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];
}