tags:

views:

50

answers:

1

I have a custom class, derived from UIView, called Element. In Element I set up some IBOutlets to handle some UIImageViews I have in my XIB.

My ViewController adds the Element object to a larger view where the Element moves around. And I added an Object with class Element in IB, and connected the Outlets up through that. But in my Element class, I can't set any variables for an Outlet, nor can I get any variables, for it will output (null). Am I linking everything up wrong? It'd be really nice to get this to work right.

Edit: Basically it's like the Outlet linking doesn't actually link, so I'm trying to get/set blank objects.

+1  A: 

You may need to explicitly tell IB about your custom class. In IB, highlight your custom object and select the "Classes" in the Library pane. If you can't see an inheritance tree all the way back to NSObject, use "File -> Read Class Files..." to read in the header for your class.

John Franklin
Well I'm using Xcode4, but IB does know about the class. There's a button that will link back to Element.h file.
Jman012
Sorry, I haven't upgraded to Xcode 4 yet. Every time I upgrade to a new SDK something breaks, and I don't currently have a day to burn to fix my projects.
John Franklin