Connecting outputs for a custom UITableViewCell in Xcode 4 for iOS 5

In Xcode 4, to create iOS 5 applications, I can create custom UITableViewCells. I created a subclass of UITableViewCell and created a prototype cell. I assigned a subclass to this prototype cell. Then I can use the cell. It's not a problem.

But I can't get Xcode 4 to allow me to drag the assignment points of the subclass to refer to the views inside the cell. I have to write the properties manually and then drag them. Does Xcode 4 support this?

+4
source share
1 answer

! [Connecting an outlet in Xcode4 iOS 5] [1]

Man, exactly what I was interested in. Connecting custom cells in the storyboard is simply not complete.

How to make it work:

  • Create a CustomCell class, define this custom class on the right, Utility Inspector / Identifier
  • Add IBOutlets to .h manually
  • Drag the user interface elements into the cutom cell in the storyboard so that they are available in the document structure.
  • In the "Document context menu" section, click the context menu of the context menu for the outline of the element, from + drag to the user cell, release, the second context menu will appear and you can choose from the previously defined IBOutlets.

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

(PS: Oops blabla,

We are sorry, but as a mechanism to prevent spam, new users are not allowed to post images. Earn more than 10 reputation to send images.)

+5
source

Source: https://habr.com/ru/post/1399247/


All Articles