UITableView и ASIHTTPRequest - PullRequest
       2

UITableView и ASIHTTPRequest

3 голосов
/ 24 августа 2011

Как поместить загруженное изображение в ячейку?

Я не знаю, как вывести данные ответа при загрузке в 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];
   }

1 Ответ

2 голосов
/ 24 августа 2011

Здесь - это пример кода с направляющей линией и краткое описание.

...