Xcode 中的 Leaks Instrument 在这里向我显示了内存泄漏。我已经评论了 Leaks 抱怨的受影响的线路。但我在内存管理中没有看到任何错误......
- (void)setupViewController {
MyViewController *myVC = [[MyViewController alloc] init];
UITabBarItem *tbi = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemDownloads tag:1];
myVC.tabBarItem = tbi; // LEAK: 128 bytes
self.myViewController = myVC;
[myVC release];
[tbi release];
}
我的意思是... tbi 和 myVC 最后发布,alloc 是平衡的。那么有什么问题呢?我不明白。