I'm quite new to iOS development. I'm trying to create an iPad app where I need to display an image (here I used a.png). Image shows properly on the first view controller. Then, I navigate to other view using
[self.navigationController pushViewController:<#(UIViewController *)#> animated:<#(BOOL)#>]
On the second viewcontroller, where I navigate to, I have put an UIImageView on the viewcontroller in the .xib using the interface builder. But, on running, when I navigate to the second viewcontroller, the imageview in the second viewcontroller is not displayed.
That is, on any normal viewcontroller uiimageview is working perfectly, but after navigation (i.e. self.navigationController pushViewController), the uiimageview isn't displayed in the next viewcontroller.
I tried debugging. After running the flow goes to the viewDidLoad of the second viewcontroller. I even tried to alloc the UIImageView in the viewDidLoad, on running the control goes to alloc of UIImageView, and even is allocated properly (that is not nil). But still, I'm not sure why image is not visible.Earlier I figured maybe it is not loading and on appear it is nil, but on debugging I found it is not nil.
I'm stumped. Can't figure out what I may be missing.
Suggestions please. I need help to figure out what all may be the cause of UIImageView image not being displayed.
code
PhotoGalleryViewController *photoGalleryViewController = [[PhotoGalleryViewController alloc] initWithNibName:@"PhotoGalleryViewController" bundle:nil]; [self.navigationController pushViewController:photoGalleryViewController animated:YES]; – Monty