Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-27-2011, 04:43 PM   #15 (permalink)
RyanG
Registered Member
 
Join Date: Oct 2010
Location: PA
Posts: 11
RyanG is on a distinguished road
Default

Quote:
Originally Posted by ichi View Post
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!
RyanG is offline   Reply With Quote
 

» Advertisements
» Online Users: 402
10 members and 392 guests
7twenty7, alexeir, Arty Tales, DaveDee, eski, Lily.P, networ, roof44, ryantcb, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,594
Threads: 94,084
Posts: 402,779
Top Poster: BrianSlick (7,990)
Welcome to our newest member, kopmlop
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:13 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.