[英]tagging a cell for identification in a selected tableview
how is it possible to tag an iphone cell in order to be able to use in a selected favorite table view. 如何标记iphone单元以便能够在选定的收藏夹表格视图中使用。 i want to be able to tagg the cell and its remaining content in order to be able to display it properly inside a new table view under a different view controller.
我希望能够标记单元格及其剩余内容,以便能够在其他视图控制器下的新表格视图中正确显示它。
You set a tag with a number and by looking at UIView class ref, you set it with an NSInteger, so a number to you and me. 您可以使用数字设置标签,并通过查看UIView类ref来使用NSInteger设置标签,因此您和我也可以使用数字。
tableViewCell.tag = 1
Or you extend UITableView and add your own method like 或者您扩展UITableView并添加自己的方法,例如
- (void) setFavorite:(BOOL)ans
{
favorited = ans;
}
- (BOOL) favorite
{
return favorited;
}
And then when you access the table view cell, cast it. 然后,当您访问表格视图单元格时,将其强制转换。
Probably better to make it a property though 也许更好地使其成为财产
@property (nonatmoic, assign, getter=isFavorited) BOOL favorited;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.