【发布时间】:2013-07-09 13:18:57
【问题描述】:
iOS
我们可以在应用最小化后调用该方法吗?
例如,5秒后被调用applicationDidEnterBackground:。
我使用这段代码,但是test 方法不调用
- (void)test
{
printf("Test called!");
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self performSelector:@selector(test) withObject:nil afterDelay:5.0];
}
【问题讨论】:
-
你在 AppDelegate.m 文件中的方法
applicationWillResignActive然后applicationDidEnterBackground被调用。 -
谢谢。但我的意思是,当它在后台时
-
stosha,有帮助!谢谢!
标签: iphone ios objective-c cocoa