I have two UIViewControllers.In the firstViewController,there is a button ,the button action is
SecondViewController *controller = [[SecondViewController alloc]init];
UIImage *image1 = [UIImage imageNamed:@"a.jpg"];
controller.imageView.image = image1;
[self presentModalViewController:controller animated:YES];
when the button is clicked,the SecondViewController’s view come up ,but the imageview’s image didn’t change to “a.jpg”.I need help ,thanks.
I have solved this problem.I set image as a property instead of setting imageview as a property.I set the secondViewController’s image in the firstViewController,like this:
then set the imageView in the secondViewController’s viewDidLoad method.