How to Passing Uiimage from one view controller to Other view controller when using popvivew controller used?

☆樱花仙子☆ 提交于 2019-12-12 03:48:41

问题


I Have Two View controllers.

  1. First UIViewController contain one UIImage, when I click "crop" button, go to second view controller I pass the image by push view controller, here I'am cropping my UIImage.

  2. In second UIViewController after cropping my image, clicking "done" button, I need to pass the cropped image to first view.

Problem is when I use pop-view controller, image is not passing.


回答1:


Try like this. First view controller should have a property

@property (assign)UIImage *croppedImage;

Second view controller should have

@property (assign)FirstViewController *first;

Before popping set

first.croppedImage = self.image; 



回答2:


1)Make a UIIMAGE *variable in first view controllers header.

2)set the uiimage variable from second view controller before popping.

3)POP the second view controller.

If this is not working make a singleton class consisting of uiimage variable



来源:https://stackoverflow.com/questions/14640456/how-to-passing-uiimage-from-one-view-controller-to-other-view-controller-when-us

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!