xcode 如何从索引路径获取单元格值?- IOS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11901462/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:12:16  来源:igfitidea点击:

How to get cell value from index path? - IOS

iphoneobjective-ciosxcode

提问by Feroz

I have table view. For a particular cell I had set a tag value, now, In my methods, I'm receiving index path how can I access cell.tag using index path.

我有表格视图。对于一个特定的单元格,我已经设置了一个标签值,现在,在我的方法中,我正在接收索引路径如何使用索引路径访问 cell.tag。

回答by

UITableViewCell *cell = [theTableView cellForRowAtIndexPath:theIndexPath];
NSInteger tag = cell.tag;

I hope this helps.

我希望这有帮助。

回答by erkanyildiz

int yourCellsTag = [[yourTableView cellForRowAtIndexPath:indexPath] tag];