Search code examples
iosobjective-ccocoa-touchiboutlet

The imageView can not connect to the header file for IBOulet in Objective-C


I create a xib file from New file -> iOS -> User Interface -> View , and add a Collection View Cell.

I create a header and .m file from New file -> iOS -> Cocoa Touch -> Objective-C class. and set the UICollectionViewCell to Subclass.

I want to connect the imageView and label to header file for IBOutlet , but it has no any behavior.

Like the following picture.

enter image description here

Why this condition happened ? Did I missing something ?


Solution

  • First you have to select the View and add the custom class like this:

    enter image description here