O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

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

Visual Format Language

Start a new Cocoa Application project and call it AutoLabelOut. Leave Document Based Application unchecked.

Open AppDelegate.swift and add the following code to applicationDidFinishLaunching(_:):

 ​ ​ ​ ​f​u​n​c​ ​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​(​a​N​o​t​i​f​i​c​a​t​i​o​n​:​ ​N​S​N​o​t​i​f​i​c​a​t​i​o​n​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​I​n​s​e​r​t​ ​c​o​d​e​ ​h​e​r​e​ ​t​o​ ​i​n​i​t​i​a​l​i​z​e​ ​y​o​u​r​ ​a​p​p​l​i​c​a​t​i​o​n​

 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​t​h​e​ ​c​o​n​t​r​o​l​s​ ​f​o​r​ ​t​h​e​ ​w​i​n​d​o​w​:​

 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​a​ ​l​a​b​e​l​:​
 ​ ​ ​ ​ ​ ​ ​ ​l​e​t​ ​l​a​b​e​l​ ​=​ ​N​S​T​e​x​t​F​i​e​l​d​(​f​r​a​m​e​:​ ​N​S​R​e​c​t​.​z​e​r​o​R​e​c​t​)​ ​ ​ ​ ...

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