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

Adding Tab Images

Finish out NerdTabViewController by adding individual images to the tab buttons for each view controller. The user will almost certainly enjoy being able to differentiate between the tabs.

To do this you need a way to tell the tab view controller what image to use for each tab. One approach would be to write methods for adding the child view controllers which take an image for the tab:

f​u​n​c​ ​a​d​d​C​h​i​l​d​V​i​e​w​C​o​n​t​r​o​l​l​e​r​(​c​h​i​l​d​V​i​e​w​C​o​n​t​r​o​l​l​e​r​:​ ​N​S​V​i​e​w​C​o​n​t​r​o​l​l​e​r​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​t​a​b​I​m​a​g​e​:​ ​N​S​I​m​a​g​e​)​

This would work, but it is not a great choice because it calls into question the ...

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