문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top