ASINetworkQueue asynchronous queue for iPhone

Source: Internet
Author: User

IPhoneOfASINetworkQueue asynchronous queueIs the content to be introduced in this article, using NSOperationQueue (orASINetWorkQueue, See the following example. When a queue is used, only a specified number of requests can be run simultaneously. If the request you added exceeds the maxConcurrentOperationCount attribute of the queue, the request will run after other requests are completed.

Note:ASINetworkQueueClass View introduction to the previous IPhone ASIHTTPRequest

 
 
  1. // ASINetworkQueue queue = [ASINetworkQueue alloc] init];
  2.  
  3. For (ForumItem * item in itemList)
  4.  
  5. {
  6.  
  7. // Address of the item. Image
  8.  
  9. If (item. Image)
  10.  
  11. {
  12.  
  13. ASIHTTPRequest * request = [ASIHTTPRequest requestWithURL: [NSURLURLWithString: item. Image];
  14.  
  15. Request. userInfo = [NSDictionary dictionaryWithObject: item. ImageforKey: @ "Image"];
  16.  
  17. [Request setDelegate: self];
  18.  
  19. [Request setDidFinishSelector: @ selector (requestDidFinished :)];
  20.  
  21. [Queue addOperation: request];
  22.  
  23. }
  24.  
  25. }
  26.  
  27. [Queue go];

Release Notes

 
 
  1. queue 

Summary:IPhoneOfASINetworkQueue asynchronous queueI hope this article will help you!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.