我聲明瞭rightbutton工具欄的屬性和這樣UIBarbutton項目分配泄漏 - iphone
if(self.toolBar == nil)
self.toolBar = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonItem = self.toolBar;
- (void)viewDidUnload {
toolBar = nil;
}
- (void)dealloc {
[toolBar release];
[super dealloc];
}
分配它,當我來到這個屏幕是第二次(被稱爲第二次viewDidLoad中),在的UIBarButtonItem是根據儀器泄漏。什麼可能是錯的?
感謝您的提前幫助。
可能聽起來很蠢,但你肯定在泄漏儀器中看到這個? (而不是殭屍或分配) – Matt 2011-05-20 13:30:37
是它在泄漏.- – user542584 2011-05-20 14:04:34