我想了解以下行代码的内存管理的影响:Objective-C的内存管理问题
// in tableView:cellForRowAtIndexPath
cell.accessoryView = [[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"test.png"];
我打电话alloc
这通常意味着我打电话release
地方。 UITableViewCell
的accessoryView
设置属性是retain
所以(我认为)该单元将“取得”UIImageView
的所有权。 关于内存管理,上面的代码行究竟发生了什么?