Smeegol
Smeegol

Reputation: 2098

How to set UITableViewCell Identifier in Xcode 4

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

Upvotes: 3

Views: 7850

Answers (3)

user244343
user244343

Reputation:

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.

Upvotes: 5

tong.zhilian
tong.zhilian

Reputation: 1

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

Upvotes: 0

Ricky
Ricky

Reputation: 3171

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.

Upvotes: 1

Related Questions