【问题标题】:UITableView and ASIHTTPRequestUITableView 和 ASIHTTPRequest
【发布时间】: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


    【解决方案1】:

    Here是一个示例代码,有一个指导线和a brief description.

    【讨论】:

    • 是的,FlickrCell 是自定义单元格。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多