如何将下载的图像放入单元格?
我不知道在加载到cell.imageView.image
时如何将响应数据输出。
以下是代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
....
....
NSURL *photoURL = [NSURL URLWithString:user.photo];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:photoURL];
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setDelegate:self];
[request startAsynchronous];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@",user.first_name,user.last_name];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
//image loaded
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSData *responseData = [request responseData];
}