So I have things nested like this in a nib:
UIViewController
|
|-UIView (container for some about text UILabel)
| |
| UILabel
|
UIScrollView (makes image scalable)
|
UIImageView
I’m trying to load the image of the UIImageView programmatically in another view controller, then pushing the new UIViewController onto a UINavigationController. Everything works fine, but when I assign the image, nothing appears on the new view.
So in a connectionDidFinishLoading: I do this:
UIImage* image = [UIImage imageWithData:imageData];
MyImageController* imageController = [[MyImageController alloc] init];
imageController.title = expandImage.title;
imageController.imageView.image = image;
[self.navigationController pushViewController:imageController animated:YES];
Nothing shows up besides what I designed in the nib. Any help?
Try these solution for your problem:
1.First of all, be sure that you get an image and you have an image data in the
imageDatavariable.2.most likely this solution is what you are looking for. declare a variable in the
MyImageControllerof typeUIImage, and set the propriety and synthesize for it, then in yourconnectionDidFinishLoadingcode, set the returned image to the variable that you declare, and in theMyImageControllerassign the variable to theimageController.imageView.i hope that help you, and tell me what you got from these solution
good luck.