开发者

How to download 100 images at a time with gtm-http-fetcher?

I'm using gtm-http-fetcher in my application. It's easy to fetch a single resource with it. Now I need to download 100 pictures at a time. I have the URL for ea开发者_如何学编程ch image. When I get a image, I need to match it with its URL. What should I do?

UPDATE: May I put all the fetchers into an operation queue to fetch images concurrently?


The URL is available as

  NSURL *url = fetcher.mutableRequest.URL;


You could set up a dictionary and map the connection object to the url

NSDictionary *dict = [NSDictionary dictionary];  //you'll need to retain this
...
[dict setObject:thisUrl forKey:thisConnection];

Then get the urls out when you need them when the connection finished loading

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
...
     NSURL *url = [dict objectForKey:thisConnection]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜