2011-02-23 223 views
1

我在開發iphone應用程序時遇到了一個問題。我想知道如果應用程序從後臺重新打開,我怎麼能意識到這種狀態?iphone:如何知道從後臺打開的應用程序

這意味着:我打開我的應用程序,做一些業務邏輯。之後,我按下'Home'按鈕將當前應用程序設置爲背景狀態。之後,我雙擊'Home'按鈕來查看應用程序在後臺運行。我選擇我的應用程序重新打開它。我如何知道應用程序從後臺狀態重新打開?

謝謝

回答

1
- (void)applicationWillEnterForeground:(UIApplication *)application { 
    /* 
    Called as part of transition from the background to the active state: here you can undo many of the changes made on entering the background. 
    */ 
} 
+0

該方法在ApplicationDelegate中。我想用我目前的觀點來了解它。 – haisergeant 2011-02-23 08:39:18

+1

只要你從背景進入,這個代表就會打電話,而不管這些意見。 – KingofBliss 2011-02-23 08:43:51

+0

你爲什麼要查看視圖? – KingofBliss 2011-02-23 08:44:10

相關問題