I have an game in which when the user accepts a phone call or gets a text-message or ect. I want to pause the game. In the App Delegate my GameView Controller are accessed as so:
but this isn't working. Their are no errors but this doesn't do anything. Can somebody help?
HTML:
[B] .h file [/B]
#import <UIKit/UIKit.h>
@class MainViewController;
@class GameViewController;
@interface StarFighterAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
MainViewController *mainViewController;
GameViewController *gameViewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet MainViewController *mainViewController;
@property (nonatomic, retain) IBOutlet GameViewController *gameViewController;
@end
[B] .m file [/B]
- (void)applicationWillResignActive:(UIApplication *)application { // Need!!!!!!!!
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
[gameViewController PauseAction];
}
- (void)applicationDidBecomeActive:(UIApplication *)application { // Need!!!!!!!!
/*
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.
*/
[gameViewController PlayAction];
}