Ios 无法强制转换类型为';待办事项列表。AddItemViewController';(0x1009f3970)至';待办事项列表。ListDetailViewController';(0x1009f3850)
我已经创建了一个列表,在其中我提供了一个用于编辑列表的详细信息披露按钮,但是当我单击该按钮时,它显示了一个错误 无法强制转换类型的值 这是我的密码:Ios 无法强制转换类型为';待办事项列表。AddItemViewController';(0x1009f3970)至';待办事项列表。ListDetailViewController';(0x1009f3850),ios,iphone,xcode,swift,Ios,Iphone,Xcode,Swift,我已经创建了一个列表,在其中我提供了一个用于编辑列表的详细信息披露按钮,但是当我单击该按钮时,它显示了一个错误 无法强制转换类型的值 这是我的密码: override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) { let navigationController = storyboard!.instantiateVie
override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath)
{
let navigationController = storyboard!.instantiateViewControllerWithIdentifier("ListNavigationController") as! UINavigationController
let controller = navigationController.topViewController as! ListDetailViewController
controller.delegate = self
let checklist = dataModel.lists[indexPath.row]
controller.checklistToEdit = checklist
presentViewController(navigationController, animated: true, completion: nil)
}
我分析了您的项目,建议您删除所有不需要的导航控制器,并将此代码添加到
accessorybuttonappedforrowwithindexpath
方法中:
let VC = storyboard!.instantiateViewControllerWithIdentifier("ListNavigationController") as! ListDetailViewController
self.navigationController?.pushViewController(VC, animated: true)
我分析了您的项目,建议您删除所有不需要的导航控制器,并将此代码添加到
accessorybuttonappedforrowwithindexpath
方法中:
let VC = storyboard!.instantiateViewControllerWithIdentifier("ListNavigationController") as! ListDetailViewController
self.navigationController?.pushViewController(VC, animated: true)
是的,如果你能解决我的问题,我想与你分享。好的。但是请尽快回复。是的,如果你能解决我的问题,我想与你分享。好的。但请尽快回复。