A method for when someone texts during the game is running?

I've been making a game and I'm wondering, is there a method for when someone texts or something else pops up that disrupts during when the game is running? (I want it to pause the game) Right now when someone texts during the game it still runs behind the text alert.

Rasterman Wrote:I was wondering why they don't put any of this into the simulator

Presumably a combination of limited development resources at Apple, and a desire to encourage developers to test on real devices. The simulator is not an emulator; it's a relatively thin software layer that essentially lets you run a Mac application in an iPhone-like context. A full-blown iPhone emulator could give you a higher-fidelity representation of how software would run on a real device, but it would be much slower to execute on the Mac, and a much larger development effort for Apple.

Yes, there is a way to test this in the Simulator. Command-L will simulate locking the device. When you lock the device, it also calls applicationWillResignActive. Sliding the unlock bar invokes applicationDidBecomeActive.

It's smart to handle those messages because they are invoked for many reasons like when you get a low battery warning, receive a phone call on iPhone, the device times out from inactivity, and several other reasons.