You need to describe your problem better. What's the crash log in the console?
1. Why are three view controllers active at the same time?
2. There's also a 'application:didReceiveRemoteNotification:' method in the app delegate that is invoked if your app is running at the time you receive the notification.
3. You shouldn't be passing the @2x suffix explicitly. It's up to iOS to look for it and choose the right image file (low or high res) depending on which device the app is running.
1. They aren't active at the same time, but i have to include all three otherwise it wouldn't work in all three viewcontrollers, would it?
Because I can't know which viewcontroller is active at the moment.
2. where's the difference?
3. sorry about that, thanks
1. How can you send a message to an object that doesn't exist? Again, look in the console and see what exception is being thrown, that's the clue to where the problem is. Why do you have three different controllers for gameplay? Generally you have one that you customize based on the game contents at the time. I can't give you specific suggestions because I have no idea about what the contents of those nibs are or how you structured the app.
2. If the app is running and you want to receive push notifications, you have to code it in that method.
First of all, the concept of the game:
When you start the app, a main view is shown where you can choose one of three different game modes.
So, if the user plays in one game mode and gets a sms, the game should pause and if he cancels the notification, the game should go on.
1. Of course I can't but I have to put the code in my appDelegate, don't I?
the console says:
+[FirstViewController pauseGame]: unrecognized selector sent to class 0x1d39c
2011-04-03 10:32:48.025 theAppName[317:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FirstViewController pauseGame]: unrecognized selector sent to class 0x1d39c'
terminate called after throwing an instance of 'NSException'
You need to have references to instances of those view controllers in your delegate to do that. Then call the methods on the instances, not the class. Instance variables are a good option.
what do you mean with references?
should I import the viewController like #import "FirstViewController.h" in my AppDelegate and then call the pauseGame method like [self pauseGame] ?