views:

201

answers:

1

I created a new iPhone project using the built-in "tab bar" template.

I put a few sliders, labels, textfields in the view.

I added in needed code for: "IBOutlet, @property, @synthesize, and release" for the above UI objects.

It saves and compiles without any errors or warnings.

I try to hook-up my connections with control-drag, but don't see any of my IBOutlets appearing in the list. I can't seem to "connect" any outlets from IB to my code. (My IBActions all connect fine)

What did I do wrong?

A: 

I imagine the issue is that you need to tell Interface Builder that the object you're trying to connect those UI objects to is your own subclass.

For example, if you're trying to connect them through the "File's Owner" proxy object, select "File's Owner" and go to Tools -> Identity Inspector. In the "Class" textfield, enter the name of your custom subclass. Now IB knows to check that class' header file for custom IBOutlets and IBActions.

Matt B.
I will try that tomorrow. Oddly, I NEVER had to do any of that before, nor have I even seen that mentioned in any of the 12 iPhone books I have. Maybe because of the tabbar and multiple views in this particular app?
Bonnie
That fix worked. Now the BIG questions: Why have I written so much code over the past few months... and NEVER ran into that problem before? Why was this solution needed... all of a sudden?So what did it really do? I needed to tell IB... "where" to find my IBOutlet definitions. (My IBActions were already working. Not sure why.)
Bonnie
Now I can make my IBOutlet connection... but the whole thing just crashes. I set my File's Owner back to its original value: UIApplication.But now I can no longer make my IBOutlet connections. Hmmmm...
Bonnie