AFN clear picture cache and Daisy circles

Source: Internet
Author: User

Afnetworking Network Library has provided a good picture caching mechanism, the efficiency is relatively high, but I found that there is no direct provision of the ability to clear the cache, the project usually need to add

The functionality of the function is cleared, so here I add the following purge function method to the Uiimageview+afnetworking class:

[OBJC]View Plaincopyprint?
    1. /**
    2. Clear Image Cache
    3. Author:huangyibiao
    4. */
    5. + (void) ClearCache;

[OBJC]View Plaincopyprint?
      1. /**
      2. Clear Image Cache
      3. Author:huangyibiao
      4. */
      5. + (void) ClearCache {
      6. Afimagecache *cache = (afimagecache *) [Uiimageview Sharedimagecache];
      7. [Cache removeallobjects];
      8. return;
      9. }

Just beginning to contact AFN, found that chrysanthemum always do not turn, the results Baidu does not come out, then simply use ASI,

Today there is time to specialize in AFN, read the API inside, only to find that by default the AFN turns the Chrysanthemum is closed,

Need to be opened manually to be able to display the loop, open the method is:

[OBJC]View Plaincopyprint?
    1. [Afnetworkactivityindicatormanager Sharedmanager]. Enabled = YES;


You can add this method in Appdelegate

Original URL: http://blog.csdn.net/woaifen3344/article/details/41211745

AFN clear picture cache and Daisy circles

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.