ImageLoad From Server in iPhone

In this application we will see how to image fetch from the server and place it to the view. I will show you the easiest way for image fetch from server. So let see how it will work.

Step 1: Open the Xcode, Create a new project using Window base application. Give the application “imageLoad”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: We need to add one ViewController class in the project. So select the project -> New File -> Cocoa Touch ->ViewController class and give the class name “ImageLoadFromServer”.

Step 4: Open the ImageLoadAppDelegate.h file, we need to define ImageLoadFromServer class and create an instance of ImageLoadFromServer class. So make the following changes in the file.

 

 

 

Step 5: Now make the following changes in the ImageLoadAppDelegate.m file.

 

 

 

Step 6:  Open the ImageLoadFromServer.h file and create an instance of UIImageView. So make the following changes in the file:

 

 

 

Step 7: In the ImageLoadFromServer.m file make the following changes:

 

 

 

Step 8: Now compile and run the application in the Simulator.

You can Download SourceCode from here ImageLoad

Leave a Comment:

3 comments
Dipak Patil says May 24, 2011

it’s usable,,,,,,,,,,,,,

Reply
J Alex Antony Vijay says May 26, 2011

Hi,

I am having few doubts. Could you explain is there any other way to load images from server ?
Because if I am loading more than 5 images from server, it will take more time to make it as UIImage. Just try like; Load more than 5 images and display it in the UITableView.

What I am doing is; I am making a request to web service, then I will get list of images URL. After that I will make all the images like “UIImage”, then I am displaying in the UITableView.

Actually we can use UIWebView instead of UIImageView to display the Images. But the issue is; When we are using the Thread in the current controller, we will get error.

If you have some knowledge please share with us.

Thanks.

Reply
yasha says October 19, 2011

Your code is not working I see a white screen on launching your app

Reply
Add Your Reply