If you are using .xib to navigate from one ViewController
to another then this code might help you.
Suppose you have image in you FirstViewController
UIImage *image = [UIImage imageWithData:imageData];
//------Time to go at another Class lets call it secondViewController
secondViewController *secondview =[[secondViewController alloc] initWithNibName:@"secondViewController" bundle:nil WithImage:image];
[self.navigationController pushViewController:secondview animated:YES];
SecondViewController.h
@interface secondViewController : UIViewController
@property (nonatomic,strong)UIImage *imagefromServer;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil WithImage:(UIImage *)image;
@end
SecondViewController.m
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil WithImage:(UIImage *)image
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
imagefromServer= image;
}
return self;
}
Hope helps you