我正在为我的应用程序的UIWindow创建子类,然后当用户没有活动时,我使用NSNotificationCenter发出通知。我在用 [NSTimer scheduledTimerWithTimeInterval:target:selector:userInfo:重复:]
我在AppDelegate类中处理这个问题。这工作正常,除非我使用MBProgressHUD运行代码 - http://iosdevelopertips.com/open-source/ios-open-source-heads-up-display-with-mbprogresshud.html 我认为开始另一个线程。当它的完成委托与响应通知的代码正在运行时同时触发时发生错误。我很确定这是一个线程问题,但我该如何避免这种情况