1

I have an iphone game that plays background music using AVSoundPlayer - when someone locks the iphone the music stops which is fine. But when someone unlocks it, I don't want my music to start playing again while you're staring at the "slide to unlock" screen - I want it to start playing once you've actually slid the button and the app is visible again - is there some way to detect this? (I've tried applicationDidBecomeActive but that fires when the phone is unlocked but not when your app is visible yet...)

4

2 回答 2

0

你可以试试 viewWillAppear。

于 2009-06-17T18:26:28.683 回答
0
- (void)applicationDidBecomeActive:(UIApplication *)application;

当您的应用程序激活时发送

SO适用于您的问题的另一个答案:

只要我不关闭 iPhone,applicationWillTerminate 就可以工作

于 2009-06-17T19:20:35.113 回答