If I create a UIImageView
via Storyboard and add it as a @property
into a ViewController.h
, I can access that UIImageView
fro
The answer AgnosticDev is trying to say here is to add an ivar to your view controller's .h file... e.g.:
@implementation YHLViewController : ViewController
{
UIImageView * currImageView;
}
And then in your "viewDidLoad
" method, you can allocate and initialize it via:
currImageView = [[UIImageView alloc] init];
and have access to it from anywhere else in your view controller.
You would need to create your UIImageView in your header file and then it would be available throughout the rest of the view. You will need to add it to the view in viewDidLoad though.
Header
UIImageView *image;
Main // ViewDidLoad
image = [UIImageView alloc] .....
[self.view addSubView image];
Main Function .....
[image setImage ....