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

Multiple initializers

Create a new file: a subclass of BNRAppliance named BNROwnedAppliance. In BNROwnedAppliance.h, add a mutable set of owner names and three methods.

#​i​m​p​o​r​t​ ​"​B​N​R​A​p​p​l​i​a​n​c​e​.​h​"​

@​i​n​t​e​r​f​a​c​e​ ​B​N​R​O​w​n​e​d​A​p​p​l​i​a​n​c​e​ ​:​ ​B​N​R​A​p​p​l​i​a​n​c​e​ ​
@​p​r​o​p​e​r​t​y​ ​(​r​e​a​d​o​n​l​y​)​ ​N​S​S​e​t​ ​*​o​w​n​e​r​N​a​m​e​s​;​
-​ ​(​i​n​s​t​a​n​c​e​t​y​p​e​)​i​n​i​t​W​i​t​h​P​r​o​d​u​c​t​N​a​m​e​:​(​N​S​S​t​r​i​n​g​ ​*​)​p​n​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​f​i​r​s​t​O​w​n​e​r​N​a​m​e​:​(​N​S​S​t​r​i​n​g​ ​*​)​n​;​
-​ ​(​v​o​i​d​)​a​d​d​O​w​n​e​r​N​a​m​e​:​(​N​S​S​t​r​i​n​g​ ​*​)​n​;​
-​ ​(​v​o​i​d​)​r​e​m​o​v​e​O​w​n​e​r​N​a​m​e​:​(​N​S​S​t​r​i​n​g​ ​*​)​n​;​ @​e​n​d​ ...

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