使用imagePickerController委托函数时获取不明确的引用:

时间:2016-09-29 01:35:52

标签: ios swift

我试图覆盖UIImagePickerControllerDelegate中的imagePickerController函数。但是,我似乎得到了一个错误:

Ambiguous reference to member 'subscript'

我已经完成了多次谷歌搜索,这似乎对其他人一切正常?

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]){


    myImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage

    self.dismiss(animated: true, completion: nil)


}

非常感谢任何帮助。谢谢

1 个答案:

答案 0 :(得分:8)

您的委托方法签名错误。它应该是:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])