所以我在第一个控制器中有这个代码。
var countries = ["American", "Asian", "Italian"]
var items = [["Mcdonalds", "BurgerKing", "Big Boy"], ["PFChangs", "China One Buffet"], ["Pizza House", "Pizza Hit", "Olive Garden", "Maggianos"]]
if (segue.identifier == "segueone")
{
let cellIndexPath = self.tableView!.indexPathForCell(sender as UITableViewCell)
if let unwrappedCellindexPath = cellIndexPath
{
var nextVC = (segue.destinationViewController as TableTwo)
nextVC.items = items[unwrappedCellindexPath.row]
}
}
}
在第二个表控制器上我有
var items: [String]?
我期待进一步处理。我想将双数组中的一个特定值转换为第三个控制器。我知道我的代码不会有太大的不同,但我不确定如何从我的第二个控制器中的双数组发送特定索引到第三个控制器?
答案 0 :(得分:0)
您要传递索引还是项目? 要传递你想写的项目
nextVC.item = items[unwrappedCellindexPath.row][index2]