【发布时间】:2011-08-24 08:03:00
【问题描述】:
如何将下载的图片放入单元格中?
当响应数据加载到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];
}
【问题讨论】:
标签: uitableview asihttprequest