4

In XCode 4 for building iOS 5 apps, I can create custom UITableViewCells. I have created a subclass of UITableViewCell and created a prototype cell. I have assigned the subclass to that prototype cell. Then I can use the cell. That's no problem.

But I cannot get XCode 4 to allow me to drag-assign the outlets of the subclass to refer to views inside the cell. I have to write the properties manually and then drag-assign them. Does XCode 4 capable of this?

user1234448
  • 271
  • 1
  • 5

1 Answers1

5

![Connecting the outlet in Xcode4 IOS 5][1]

Man, exactly what I was wondering. Connecting custom cells in storyboard just seems not finished.

How to make it work:

  • Create CustomCell class, identify this custom class in the right, Utilities / Identity inspector
  • Add the IBOutlets to the .h manually
  • Drag the UI elements on the cutom cell in the storyboard, so they are available in the Document Outline.
  • In the Document Outline, right click context menu for the element outline, from + drag to the custom cell, let go, the second context menu appears and lets you select from your previously defined IBOutlets.

(CTRL-click drag from the element itself to the .h file just doesn't work.)

(PS: Oops blabla,

We're sorry, but as a spam prevention mechanism, new users aren't allowed to post images. Earn more than 10 reputation to post images.)