开发者

donloading gif giles in iphone - improving performance

I have a table view showing records When user taps ona record I need to show the details of that record The detail shown also includes an image that I need to download from awebserver ( GIF ) file

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection release];
[request release];

NSData *imageData = [NSData dataWithContentsOfURL:url];

The problem is the last line where it takes some time to download the image

I am wondering what the possible options should be / can be done

I know the initWithRequest is aynchronous - but the call to dataWithContentsofUrl is right in the main path - so user experiences a wait time of more than a second

Is there a way that I could possibly have the dataWithContentsofUrl pushed into some other method that is called asynchronously

If thats possible I could look at showing a spinner or "please wait...." while the image loads

The other option I am thinking of is : Should I have the images saved on the server in a zipped format ? and then unzip ? will it be faster ? has anyone tried it before ? or does anyone have a better option ?

I am not lookin开发者_Python百科g for spoon feeding but would like to hear your ideas please!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜