In Xcode 4, I failed to find where to set UITableViewCell's Identifier, can anybody helps me? Thank you very much.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In code:
myTableViewCell.reuseIdentifier = @"CustomIdentifier";
In the interface design document (right-click and view image to get a bigger picture):
- Go to the leftmost tab here, the Project navigator.
- Select the
.xib
file containing your cell design. - Select the
UITableViewCell
object within the.xib
- Make sure the rightmost "View" is showing and then go to the 4th-from-left tab, the Attributes inspector.
- The top box labelled "Identifier" is where you enter your identifier.
回答2:
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.
回答3:
You can use the attribute named 'tag', type of NSInteger