views:

129

answers:

1

I just want to confirm that I'm understanding correctly, in Interface Builder the Class set under Class Identity (listed under Type in the name.xib summary window) is the class of the view whereas in IBOutlet Class *viewName the class listed describes the nature of the connection to Interface Builder, is this correct?

e.g.

Name__________________Type

File's Owner_____________SomeViewController

First Responder__________UIResponder

MyLabel________________UILabel
.

IBOutlet UILabel *lblMyLabel

UILabel is the class of the label and IBOutlet UILabel is the type of connection between the code and the IB object, right?

I ask because I subclassed UIImageView & updated the view's class but left the IBOutlet declaration as IBOutlet UIImageView and it still works so I assume the IBOutlet part is just a description or a guideline.

A: 

if you are speaking about the IBOutlet keyword that you put in the @interface part of the class like this:


@interface Myclass {
  IBOutlet SomeOtherClass *myObj;
}

, this tells Interface Builder that you will use this class member to connect to o a "SomeOtherClass" object in Interface Builder. After you write this member, you will be able to drag a connection from this object to a "SomeOtherClass" object in interface builder and select the "myObj" outlet, and when the .nib will be read at runtime, you will have both the objects and the connection between them available. The "UILabel" that you mentioned is indeed the class of the object.

matei