嗯嗯嗯 服務器端提供了一個圖形驗證碼地址,ios客戶端如何更新呢

用的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];

 

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章