views:

217

answers:

2

I am trying to learn iPhone development and someone passed along the website www.appsamuck.com. On Day 1, the tutorial instructs the developer

We need to reference the label in our code so we can update the label

* In the document window "File's Owner"
* Click: Tools->Idenity Inspector
* In the inspector click the + under "Class Outlets"
* Change myOutlet1 to "countdownLabel"
* Change id to UILabel
* Click enter to make sure they commit

I really don't want to get hung up on this, but I can't find "Class Outlets" either when creating a new project from scratch or opening the zipped source code project. Is this just a difference in versions of Interface Builder? Where did it go?

A: 

Yes, there are various flavors of the Interface Builder that comes with XCode. Especially 3.0 and tutorials written prior that version are a serious pain. You can find the Class Outlets in the Inspector pane. The icon that is blue with a little 'i', is where you should click on.

Shyam
+1  A: 

Class outlets are used to connect objects defined in Interface Builder with ivars and properties defined in the source code. The feature you are looking for has moved since the tutorial was written.

In version 3.2.2, you want to click the File's Owner in the document window. Open the Object Inspector and click on the Info tab icon. Here you can set the class name. You can click the gray arrow in the class name text box or open the Library window. In the Library window click the Classes tab at the top then click the Outlets tab at the bottom. This is where you will see the list of outlets and can add or remove outlets.

Here's a screen shot that might make it easier to follow the steps:

http://skitch.com/kirbyt/n6wm3/classoutlets

Hope that helps.

-KIRBY

Kirby T
So do people normally add class outlets like this in Interface Builder? Or do they normally add them in the header file in Xcode?
chrish
It's faster for me to add them in the header file in Xcode, but I guess some people prefer to stay in IB. Some tutorials and books teach the IB approach too, which I'm guessing is easier for beginners since it involves less switching between IB and Xcode when first learning.
Kirby T

related questions