How to set UITableViewCell Identifier in Xcode 4

前端 未结 3 565
滥情空心
滥情空心 2021-01-21 04:53

In Xcode 4, I failed to find where to set UITableViewCell\'s Identifier, can anybody helps me? Thank you very much.

相关标签:
3条回答
  • 2021-01-21 05:17

    You can use the attribute named 'tag', type of NSInteger

    0 讨论(0)
  • 2021-01-21 05:19

    When you create a new UITableViewCell in an interface document, select it, show Utilities by pressing Cmd+Opt+0. Under the "Attributes" inspector the first object is your identifier.

    0 讨论(0)
  • 2021-01-21 05:32

    In code:

    myTableViewCell.reuseIdentifier = @"CustomIdentifier";
    

    In the interface design document (right-click and view image to get a bigger picture): Image of Xcode 4 showing location of UITableViewCell identifier

    1. Go to the leftmost tab here, the Project navigator.
    2. Select the .xib file containing your cell design.
    3. Select the UITableViewCell object within the .xib
    4. Make sure the rightmost "View" is showing and then go to the 4th-from-left tab, the Attributes inspector.
    5. The top box labelled "Identifier" is where you enter your identifier.
    0 讨论(0)
提交回复
热议问题