所以我环顾四周并尝试了一些不同的东西,我似乎无法弄清楚为什么图像没有被保存到UIImageView。我已经检查过,View Controller符合所有协议,我已经将Image Picker委托设置为self。这是处理所选图像的代码。其他所有工作只是选择后没有图像发送到图像视图。
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
picker.dismissViewControllerAnimated(true, completion: nil)
}
答案 0 :(得分:1)
首先尝试解雇imagePicker
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject])
{
picker.dismissViewControllerAnimated(true, completion: nil)
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
}