我有兩個tableviews。一個選擇一個選項卡時加載,另一個選擇另一選項卡時加載。使用製表符控制器和MBProgressHUD切換tableviews時崩潰
我使用MBProgressHUD來允許在標籤之間快速切換,因爲我使用Objective Resource從網絡中拉取tableview數據源,這可能需要一點時間。所以我拋出HUD進度指示器等待數據加載。
這反過來又讓我快速切換標籤。但是....如果我這樣做,速度不夠快,發生異常時
EXC錯誤訪問
與NSZombiesEnabled我得到這個: 2010-08-02 22:44:43.116電影節[962:8703] * ** - [MBProgressHUD發佈]:發送到釋放實例的消息0x85490b0
在我的兩個桌面視圖中,我使用兩個不同的自定義tableviewcells。
我的下一步應該怎樣調試呢?
...所以我已經移動代碼來創建從我的viewWillAppear:方法viewDidLoad HUD的代碼:和崩潰消失了。 //平視顯示器將dispable視圖中的所有輸入(使用higest視像可能在視圖層次)
HUD = [[MBProgressHUD alloc] initWithView:self.view];
//HUD.graceTime = 0.5;
//HUD.minShowTime = 5.0;
// Add HUD to screen
[self.view addSubview:HUD];
// Register for HUD callbacks so we can remove it from the window at the right time
HUD.delegate = self;
// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:@selector(loadFilms) onTarget:self withObject:nil animated:YES];
但是這並不能真正解決我的問題,因爲只有viewDidLoad中在很長髮生一次,而尤其是新的多任務處理。我需要這個HUD在每次tableview出現時觸發選擇器。
爲什麼我在viewWillAppear中發生它是不正確的......是因爲它可以被加載太多,我只是繼續分配對象? perhasp我應該分配在viewDidload和火的
// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:@selector(loadFilms) onTarget:self withObject:nil animated:YES];
只在我的viewWillAppear:?
Thoughts?
我已經在該問題中添加了一些新發現。 – theprojectabot 2010-08-03 16:59:43