可能重複:
Want app upgraded to 4.0 to exit completely when home button pressed支架應用
當用戶關閉與home鍵的應用程序,我怎樣才能使應用程序重新加載與閃屏,而不是他們最後離開了應用程序。
因此,就好像他們每次打開第一次提示應用程序一樣,因爲我希望它們能夠隨時顯示帶有選項的介紹視圖。
感謝
可能重複:
Want app upgraded to 4.0 to exit completely when home button pressed支架應用
當用戶關閉與home鍵的應用程序,我怎樣才能使應用程序重新加載與閃屏,而不是他們最後離開了應用程序。
因此,就好像他們每次打開第一次提示應用程序一樣,因爲我希望它們能夠隨時顯示帶有選項的介紹視圖。
感謝
如您所說,iOS4.0具有多任務功能(即,)在後臺運行應用程序。要停止在後臺運行XCode應用程序,請在應用程序中打開info.plist。
右鍵單擊 - >添加行 - >選擇「應用程序不在後臺運行」選項 確保選中該複選框,在其右側。
我希望這能幫助你。
你可以釋放方法中的所有視圖時,用戶按下home鍵那被稱爲:
- (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.
*/
}
在這裏,您可以彈出所有視圖的初始視圖。
或者你也可以做同樣的下一個方法:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}
兩種方法可以去這個問題,據我所知;
applicationDidBecomeActive:
將被調用。您可以在此處編寫任何代碼,這些代碼將始終將用戶引導至您所需的介紹屏幕。查看參考here瞭解更多信息。
感謝您的支持,我僅僅希望得到結果。 –