Question

I have an image view object. I can get it to load images when a buttun is pressed but I want to know if there is a way to get it to load at the start of the app.

The code im using is

NSURL *lURL = nil;
NSData *lData = nil;
NSImage *lImage = nil;
lData = [lURL resourceDataUsingCache:YES];
lImage = [[NSImage allocWithZone:[self zone]] initWithData:lData];
lURL = [[NSURL alloc] initWithString:@"urltoimage"];
[imageView setImage:lImage];

any help is appreciated

Was it helpful?

Solution

Use -[UIViewController viewDidLoad] method which is called exactly once when the controller is first loaded into the memory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top