最終更新:
t_tonosama 2012年07月23日(月) 22:36:43履歴
iOS5になってから非同期通信の方法がめっちゃ簡単になっていました。
やりたいメソッドでこれやってあげればいいです。便利ー
やりたいメソッドでこれやってあげればいいです。便利ー
/// 非同期通信 NSURL *URL = [NSURL URLWithString:iconURL]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { if (error) { NSLog(@"error: %@", [error localizedDescription]); return; } cell.iconImageView.image = [UIImage imageWithData:data]; }];
コメントをかく