我有两个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