3
如何將下載的圖像放入單元格中?UITableView和ASIHTTPRequest
我不知道如何將響應數據加載到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];
}
是它自定義單元格? –
是的,** FlickrCell **是一個自定義單元格。 –