我遇到了一个奇怪的问题。请考虑以下代码:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let view = storyboard?.instantiateViewControllerWithIdentifier("weaponDetail") as! WeaponDetailsViewController
var name = ""
if resultSearchController.active {
name = filteredweapons[indexPath.row].name
} else {
name = weaponsList[indexPath.row].name
}
view.weaponName = name
view.selectionOnly = selectionOnly
view.delegate = self
view.characterID = characterID
presentViewController(view, animated: true, completion: nil)
}
它是一个带搜索栏的UITableView。当列表被过滤并且项目被点击时,我收到此错误: 警告:尝试呈现已经呈现的内容(null)
如果列表未经过滤,则可以正常使用。我错过了什么?