How to set UITableViewCell Identifier in Xcode 4

前端 未结 3 566
滥情空心
滥情空心 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: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.

提交回复
热议问题