0

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.

CRDave
  • 9,279
  • 5
  • 41
  • 59
12345
  • 157
  • 3
  • 10
  • How you are passing image when pop? – CRDave Feb 01 '13 at 06:06
  • Could you provide some code on how you are trying to pass the image object? – hishamaus Feb 01 '13 at 07:22
  • In first View -(void)btn_Press { croppedViewcontroller* myCropImg = [[croppedViewcontrolleralloc]initWithNibName:@"croppedViewcontroller" bundle:nil]; [myCropImg setScrollView:self.img.image]; [self.navigationController pushViewController:myCropImg animated:YES]; } /////here i'm doing cropping. targetview.imageview.image = self.image; [self.navigationController popViewControllerAnimated:YES]; – 12345 Feb 01 '13 at 07:29
  • may I know?where is the problem??? – 12345 Feb 01 '13 at 08:00

2 Answers2

0

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

Bharat Gulati
  • 796
  • 6
  • 12
0

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; 
Anil Varghese
  • 42,757
  • 9
  • 93
  • 110