How to access IBOutlets declared in superclass? How to access IBOutlets declared in superclass? ios ios

How to access IBOutlets declared in superclass?


I didn't realize it was even possible to connect to superclasses in interface builder until about an hour ago. Since this was the only question I could find regarding how to do this, I'll add my answer, even though this question is old. My answer is with regard to Xcode 4, not Xcode 3.

As far as I can tell, you can't connect to outlets in a superclass using the assistant editor, but you can do it by clicking on "File's Owner" in IB. That should show all the outlets in Utilities->Connections Inspector. You can then Ctrl+Click on the outlet in the inspector (click on the '+' sign), and drag it over to your view in IB.


The solution for the problem with the IBOutlet .. is to change the class type to the Base Class in the identity inspector

enter image description here

connect using Control + drag and drop and

enter image description here

change it back to the child class

enter image description here

This works for me

BTW: i used Xcode 6


IB should be able to see outlets from superclasses, I have done this a number of times with no issues. Are you sure you are importing the superclass correctly (using #import instead of @class)? IB needs some way to track back to the superclass.