Tell me, there is a ViewController with a button and an ImageView. When the button is clicked in the ImageView, a picture is downloaded from the web. The question is how to show this picture in another ViewController? Thank.
View1.h
@interface asdViewController : UIViewController { IBOutlet UIButton *actBtnGet; } @property (strong, nonatomic) IBOutlet UIImageView *ImageView; @end View1.m
#import "asdViewController.h" @interface asdViewController () @end @implementation asdViewController - (IBAction)actBtnGet:(id)sender { id path = @"http://host.ru/123.png"; NSURL *url = [NSURL URLWithString:path]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *img = [[UIImage alloc] initWithData:data]; self.ImageView.image=img; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end