To create an UiImage with a image file, I use the code as below:
UIImage *aImage = [[UIImage imageNamed:@"demo.jpg"]autorelease];
If I want to create an UiImage with the URL http://example.com/demo.jpg, how to do that?
Thanks
UPDATE

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a three step process. First you will create an
NSURLobject to hold the URL we are attempting to access. We will supply this URL to theNSDataclass method,+dataWithContentsOfURL:to obtain the image over the network as raw data, then use the+imageWithData:class method onUIImageto convert the data into an image.Please note that
+dataWithContentsOfURL:executes a synchronous network request. If you run this on the main thread, it will block the UI until the image data is received from the network. Best practice is to run any network code on a background thread. If you’re targeting OS 4.0+ you could do something like this…