SDWebImageDemo

SDWebImage

//—> imageView
//離線 —-> imageURL
//sd —> URL —> URL本地的圖片 —> 下載圖片 —> Data —> URL

//urlstr // —-> 文件夾 —> 加密

//urlstr

//md5 32位 加密 (小寫)

//- (NSString *)getMd5_32Bit {
// const char *cStr = [self UTF8String];
// unsigned char digest[CC_MD5_DIGEST_LENGTH];
// CC_MD5( cStr, self.length, digest );
// NSMutableString result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH 2];
// for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
// [result appendFormat:@”%02x”, digest[i]];
// return result;
//}
//+ (NSString )md5:(NSString )str {
//
//
//
// const char *cStr = [str UTF8String];
//
//
//
// unsigned char result[32];
//
//
//
// CC_MD5( cStr, strlen(cStr), result );
//
//
//
// return [NSString stringWithFormat:
//
//
//
// @”xxxxxxxxxxxxxxxx”,
//
//
//
// result[0],result[1],result[2],result[3],
//
// result[4],result[5],result[6],result[7],
//
// result[8],result[9],result[10],result[11],
//
// result[12],result[13],result[14],result[15],
//
// result[16], result[17],result[18], result[19],
//
// result[20], result[21],result[22], result[23],
//
// result[24], result[25],result[26], result[27],
//
// result[28], result[29],result[30], result[31]];
//
//}

import “ViewController.h”
import “UIImageView+WebCache.h”

@interface ViewController ()

@property (nonatomic,strong) UIImageView *imageView;

@end

@implementation ViewController

  • (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    NSLog(@”%@”,NSHomeDirectory());

    self.imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];

    [self.imageView setImageURL:@”http://map.onegreen.net/%E4%B8%AD%E5%9B%BD%E6%94%BF%E5%8C%BA2500.jpg” placeholder:@”1”];

    [self.view addSubview:self.imageView];
    }

發佈了83 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章