标签:http img class with 技术 too utf8 font 分享
代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
//GCD的用法
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSURL * url = [NSURL URLWithString:@"http://www.baidu.com"];
NSError * error;
NSString * data = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
if (data != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"call back, the data is: %@", data);
});
} else {
NSLog(@"error when download:%@", error);
}
});
}
标签:http img class with 技术 too utf8 font 分享
原文地址:http://www.cnblogs.com/yang-guang-girl/p/6697466.html