【发布时间】:2011-03-04 06:09:34
【问题描述】:
这些泄漏是否正常?它们是虚假泄漏还是我应该关心的事情?仪器工具没有从我的应用程序中给我任何代码行,似乎 Apple 的框架正在泄漏?! alt text http://www.freeimagehosting.net/uploads/d50bdb5dec.png
好吧,问题只能从这里来:
-
(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"ProjectDetailView" bundle:[NSBundle mainBundle]];
项目 *project = [projectsArray objectAtIndex:indexPath.row];
[detailViewController setProject:project];
[detailViewController setTitle:[项目名称]];
[self.navigationController pushViewController:detailViewController Animation:YES];
[detailViewController 发布];
}
或来自详细视图的 viewWillAppear 事件:
-
(void)viewWillAppear:(BOOL)动画{
[super viewWillAppear:animated];
[项目名称 setText:[项目名称]];
[appDefStatement setText:[项目 appDefStatement]];
[projectDesc setText:[project desc]];
NSMutableArray *theSketches = [[NSMutableArray alloc] initWithArray:[project.sketches allObjects]];
[self setSketchesArray:theSketches];
[草图发布];
if([sketchesArray 计数] == 0) {
[tView setHidden:YES];} 否则 {
[tView setHidden:NO];}
}
【问题讨论】:
-
发布您的一些代码。另外,你是在设备上分析吗?有时,模拟器并不准确。
-
我在设备上做是的。代码相当冗长乏味:)。但基本上我只是使用 TableView 和导航栏作为我的根控制器,然后用户可以选择一个单元格,将它们带到带有两个 TextField、一个 TextView 和另一个 TableView 的详细视图。如果用户在该表视图中选择了某些内容,他将再次被发送到带有 TextField 和 TextView 的详细视图。我没有对那些文本字段和文本视图做任何令人毛骨悚然的事情,它们只是附加了一个“更改”操作,当触发时通过 Core Data 将数据保存在磁盘上。
标签: iphone memory uikit memory-leaks