2011-06-29 24 views
0

我已经在ipad(ios 4)上安装了我的应用程序,并且我浏览了我的应用程序的页面。每当我关闭应用程序并重新打开应用程序,它会返回到我正在处理的最近页面。 但我希望它从第一页重新启动应用程序,每当我退出并重新打开。因为它正在iphone(ios 3.1.3)上工作,任何人都可以建议如何做到这一点在ipad上。如何重新启动应用程序,而不会去最近工作的页面,当我们退出ipad

由于事先

+0

看到这一点,解释好http://maniacdev.com/2010/07 /螺杆多任务 - 如何对化妆你-IOS-4的应用程序退出换真/。 – Ishu

回答

2

我认为你可以轻松做到这一点。你需要设置info.plist键“应用程序不在后台运行”为YES,它不会再在后台运行。 See Image below

+0

这是一个很好的答案。我应该删除我的。 +1 –

+0

谢谢@Praveen S.根据我的说法,这是最简单最合适的方法。 – Deeps

+0

另外,您需要设置布尔值为** YES **。它在屏幕截图中对NO说。 – Deeps

0

当应用程序进入背景委托方法appDidEnterBackground被调用,并且当重新开始该方法willEnterForeGround将被调用。

您可以在这些方法中处理您的应用程序行为。

欲了解更多信息,你可以参考this link,它精美地解释了概念。

0

在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. 
    */ 
} 
0

您需要UIApplicationExitsOnSuspend在您的info.plist设置为yes

0

查找资源的Info.plist文件并添加键值: “应用程序不能在后台运行”并将其值设置为1。

相关问题