Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 无法强制转换类型为';待办事项列表。AddItemViewController';(0x1009f3970)至';待办事项列表。ListDetailViewController';(0x1009f3850)_Ios_Iphone_Xcode_Swift - Fatal编程技术网

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)

是的,如果你能解决我的问题,我想与你分享。好的。但是请尽快回复。是的,如果你能解决我的问题,我想与你分享。好的。但请尽快回复。