【发布时间】:2014-10-06 22:22:17
【问题描述】:
我有一个打开的 UImage 视图,您可以用它拍照并在 uiimageview 中查看它。但是我添加了另一个图像视图并复制了代码,现在图像显示的图像与第二个相同。我相信这可能与'[UIImagePickerControllerOriginalImage];'有关。
- (void)imagePickerController:(UIImagePickerController *)
picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
// Get the image and store it in the image view
image = info[UIImagePickerControllerOriginalImage];
self.personimgThumbNail.image = image;
}
- (void)imagePickerControllertwo:(UIImagePickerController *)
picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
// Get the image and store it in the image view
imagetwo = info[UIImagePickerControllerOriginalImage];
self.personimgThumbNailtwo.image = imagetwo;
}
只需要下一步,在这一步上卡了好久。
【问题讨论】:
-
我认为您的问题可能是您有两个 didFinishPickingMediaWithInfo。如果您已将您的类声明为 UIImagePickerControllerDelegate,并将您的委托声明为 self,则它只会调用上面的第一个方法。使用您的逻辑来决定在此方法中选择了哪个选择器,即 if (picker == picker1) 等。希望这会有所帮助。
-
感谢您的反馈,但我仍然不相信我理解您所说的我应该纠正我的错误以及我应该实施什么代码来做到这一点。
标签: ios objective-c xcode uiimageview duplicates