Quote:
Originally Posted by ichi
In case this helps anyone else, I moved the image loading code out of my RootViewController where the view is loaded and into the viewDidLoad method of the class that represents the viewcontroller. Here is the final code that works...
Code:
- (void)viewDidLoad {
//taken from http://idevkit.com/forums/tutorials-code-samples-sdk/3-one-line-uiimage-url.html
UIImage *img = [[UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: @"http://someserver.com/somefile.jpg"]]] retain];
if (img != nil) { // Image was loaded successfully.
[imgView setImage:img];
[imgView setUserInteractionEnabled:NO];
[img release]; // Release the image now that we have a UIImageView that contains it.
}
[super viewDidLoad];
}
Thanks for the advice, you helped me out a lot.
|
Worked perfect thanks so much!