I can't seem to connecting any of my IBOutlets between IB and XCode
开发者_StackOverflow社区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?
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.
精彩评论