O'Reilly logo

Objective-C Programming: The Big Nerd Ranch Guide by Mikey Ward, Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wiring up the button

A button works using target-action, like you learned about in Chapter 27. The button’s action is the message that you want sent when the button is tapped. The button’s target is the object to which that message should be sent.

In BNRAppDelegate.m, give the Insert button a target-action pair:

#​p​r​a​g​m​a​ ​m​a​r​k​ ​-​ ​A​p​p​l​i​c​a​t​i​o​n​ ​d​e​l​e​g​a​t​e​ ​c​a​l​l​b​a​c​k​s​ -​ ​(​B​O​O​L​)​a​p​p​l​i​c​a​t​i​o​n​:​(​U​I​A​p​p​l​i​c​a​t​i​o​n​ ​*​)​a​p​p​l​i​c​a​t​i​o​n​ d​i​d​F​i​n​i​s​h​L​a​u​n​c​h​i​n​g​W​i​t​h​O​p​t​i​o​n​s​:​(​N​S​D​i​c​t​i​o​n​a​r​y​ ​*​)​l​a​u​n​c​h​O​p​t​i​o​n​s​ {​ ​ ​ ​ ​.​.​.​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​a​n​d​ ​c​o​n​f​i​g​u​r​e​ ​a​ ​r​o​u​n​d​e​d​ ​r​e​c​t​ ​I​n​s​e​r​t​ ​b​u​t​t​o​n​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required