im trying to apply a method in this method from a view controller in my game
when a call received to pause the game.
- (void)applicationWillResignActive:(UIApplication *)application
any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The other answers are correct in that
-applicationWillResignActive:is called on the application delegate so you just have to have that method written in your delegate to respond to that event. However if you want to write code in your view controller to listen for this event you can register for theUIApplicationWillResignActiveNotificationfrom your view controller. For example:See Apple Documentation search for UIApplicationWillResignActiveNotification.