how to detect idle user in iphone-sdk

泪湿孤枕 提交于 2019-12-05 21:45:37

Your application class is also an application delegate class - that's bad. UIApplicationMain() will create an instance of your custom application subclass, which will then try to an instance of its delegate - which is also an instance of your custom application subclass. You should separate these concerns - yes your custom app subclass needs to subclass UIApplication, but your app delegate should be a separate class that subclasses NSObject.

Suresh Varma

Try this out

-(void)applicationWillResignActive:(UIApplication *)application

{
    NSLog(@"Application not Active");
    // FETCH THE CURRENT TIME 
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!