O'Reilly logo

Cocoa® Programming for Mac OS® X For Dummies® by Erick Tejkowski

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

Chapter 20. Ten Tips to Make Cocoa Programming Easier

In This Chapter

  • Use keyboard shortcuts

  • Read the documentation

  • Use Class Browser

  • Adjust the window count

  • Use drag and drop

  • Use init and awakeFromNib

  • Don't forget the methods of the superclass

  • Position items with Cocoa coordinates

  • Use guidelines in Interface Builder

  • Reuse code

As you familiarize yourself with Objective-C and the Cocoa frameworks, you're bound to run across various tips and tricks that you'll want to remember. This chapter attempts to reduce the amount of time you have to wait until you discover some of those tips and tricks.

Use Keyboard Shortcuts

One of the easiest ways to speed up your Cocoa programming is to take advantage of the multitude of keyboard shortcuts available to you in Xcode and Interface Builder. Table 20-1 lists some of the common keyboard shortcuts that Xcode and Interface Builder share.

Table 20.1. Keyboard Shortcuts Shared by Xcode and Interface Builder

Shortcut

What It Does

Keyboard Shortcuts Shared by Xcode and Interface Builder

Saves a file

Keyboard Shortcuts Shared by Xcode and Interface Builder

Opens a file

Keyboard Shortcuts Shared by Xcode and Interface Builder

Minimizes a window to the Dock

Keyboard Shortcuts Shared by Xcode and Interface Builder

Displays help for Xcode or Interface Builder

Creates a new file in Xcode or a new NIB file ...

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