我已经在ipad(ios 4)上安装了我的应用程序,并且我浏览了我的应用程序的页面。每当我关闭应用程序并重新打开应用程序,它会返回到我正在处理的最近页面。 但我希望它从第一页重新启动应用程序,每当我退出并重新打开。因为它正在iphone(ios 3.1.3)上工作,任何人都可以建议如何做到这一点在ipad上。如何重新启动应用程序,而不会去最近工作的页面,当我们退出ipad
由于事先
我已经在ipad(ios 4)上安装了我的应用程序,并且我浏览了我的应用程序的页面。每当我关闭应用程序并重新打开应用程序,它会返回到我正在处理的最近页面。 但我希望它从第一页重新启动应用程序,每当我退出并重新打开。因为它正在iphone(ios 3.1.3)上工作,任何人都可以建议如何做到这一点在ipad上。如何重新启动应用程序,而不会去最近工作的页面,当我们退出ipad
由于事先
当应用程序进入背景委托方法appDidEnterBackground
被调用,并且当重新开始该方法willEnterForeGround
将被调用。
您可以在这些方法中处理您的应用程序行为。
欲了解更多信息,你可以参考this link,它精美地解释了概念。
在iOS 4上,应用程序不会退出它,并转到后台。当你点击图标时,应用程序会从你离开的地方重新开始。
如果你想要当它在后台,你需要实现自定义代码的appDelegate方法重置东西:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
*/
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
}
您需要UIApplicationExitsOnSuspend在您的info.plist设置为yes
Which methods are called when user presses home button and double presses it again to return
在这里你可以找到对事件的答案点击主页按钮 有趣的文章
查找资源的Info.plist文件并添加键值: “应用程序不能在后台运行”并将其值设置为1。
看到这一点,解释好http://maniacdev.com/2010/07 /螺杆多任务 - 如何对化妆你-IOS-4的应用程序退出换真/。 – Ishu