【发布时间】:2016-02-28 04:37:19
【问题描述】:
我有一个数组,用于填充 UITableView 的行。
选择一行后,我需要根据选择的行从数组中检索信息以填充一些出口(标签、文本字段等)
例如:
我在 ViewController 的 didSelectRowAtIndexPath 中为我设置为 indexPath.row 的 TableView 创建了一个 itemSelected 变量
itemSelected = indexPath.row
然后在我的 otherViewController 的 viewDidLoad 中,我需要通过
检索信息array[itemSelected]
但是,我收到一个编译器错误:“表达式解析为未使用的 i 值”
【问题讨论】:
-
您需要在 prepareForSegue 方法中将对该对象的引用发送到下一个视图控制器。
标签: ios arrays swift uitableview dynamic