For The More Curious: Application State Transitions

Let’s write some quick code to get a better understanding of the different application state transitions.

You already know about self, an implicit variable that points to the instance that is executing the current method. There is another implicit variable called _cmd, which is the selector for the current method. You can get the NSString representation of a selector with the function NSStringFromSelector.

In HomepwnerAppDelegate.m, implement the application state transition delegate methods so that they print out the name of the method. You’ll need to add four more methods. (Check to make sure the template hasn’t already created these methods before writing brand new ones.)

-​ ​(​v​o​i​d​)​a​p​p​l​i​c​a​t​i​o​n​W​i​l​l​R​e​s​i​g​n​A​c​t​i​v​e​:​(​U​I​A​p​p​l​i​c​a​t​i​o​n​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.