【发布时间】:2014-12-31 15:52:32
【问题描述】:
这是代码:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let selectedItem = items.objectAtIndex(indexPath.row) as String
let itemId = selectedItem.componentsSeparatedByString("$%^")
//itemId[1] - Item Id
}
func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
let selectedItem = items.objectAtIndex(indexPath.row) as String
let itemId = selectedItem.componentsSeparatedByString("$%^")
//itemId[1] - Item Id
}
如何添加“在数组或字符串或其他东西中......”的项目 ID?例如,当您选择第 0、1、4、5 行时,您“在数组或字符串中”添加了不同的项目 ID,然后当我想取消选择它们时,如何从被取消选择的 indexPath.row 中取消选择确切的项目 ID 并找到它“在数组或字符串或其他东西中......”并删除了它? 如果您在 cmets 有问题,请原谅我的英语不好,如果可以,我会解释
【问题讨论】:
-
我需要在数组或字符串中搜索这个被取消选择的ID,我想删除它。
标签: ios uitableview select swift deselect