用的sdwebImage
#import <SDWebImage/UIButton+WebCache.h>
首先我加載圖形驗證碼地址在一個按鈕上,作爲按鈕的背景圖
[self.myButton sd_setBackgroundImageWithURL:[NSURL URLWithString:@"這裏要寫你的圖形驗證碼全路徑地址"] forState:UIControlStateNormal];
然後呢,我點擊按鈕的單擊事件
{
然後呢 清理下緩存
[[SDImageCache sharedImageCache] clearDisk];
[[SDWebImageManager sharedManager].imageCache clearMemory];
然後呢在設置下按鈕背景
[self.myButton sd_setBackgroundImageWithURL:[NSURL URLWithString:@"這裏要寫你的圖形驗證碼全路徑地址"] forState:UIControlStateNormal];
}