Three20 TTTableSubtitleItem 内存泄漏?
我创建一个 TTTableSubtitleItem 将其添加到一个数组中,将表数据源设置为该数组,然后释放该数组,但是泄漏显示 TTTableSubtitleItem 上存在泄漏,我不确定为什么?
NSMutableArray *ar = [[NSMutableArray alloc] init];
while (item = (NSDictionary*)[enumerator nextObject]) {
NSString *result = [NSString stringWithFormat:@"tt://VideoListViewController/%@",
[item objectForKey:@"id"]];
[ar addObject:[TTTableSubtitleItem itemWithText:[item objectForKey:@"name"]
subtitle:[item objectForKey:@"description"]
URL:result]];
}
self.dataSource = [[myDataSource alloc] initWithItems:ar];
[ar release];
I create a TTTableSubtitleItem add it to an array, set the table datasource to the array and then release the array however leaks is showing a leak on TTTableSubtitleItem I am not sure why?
NSMutableArray *ar = [[NSMutableArray alloc] init];
while (item = (NSDictionary*)[enumerator nextObject]) {
NSString *result = [NSString stringWithFormat:@"tt://VideoListViewController/%@",
[item objectForKey:@"id"]];
[ar addObject:[TTTableSubtitleItem itemWithText:[item objectForKey:@"name"]
subtitle:[item objectForKey:@"description"]
URL:result]];
}
self.dataSource = [[myDataSource alloc] initWithItems:ar];
[ar release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的泄漏位于:
将其更改为:
您分配了 myDataSource 并且没有释放它。另外,您能否向我展示 .h 文件中的“dataSource”声明?
Your leak is at:
Change it to:
You allocated myDataSource and did not release it. Also, could you show me your 'dataSource' declaration in your .h file?