画像へのリンクを含むXMLファイルを解析していて、それらをUITableViewに表示しようとしています。何らかの理由で、ビューに表示されていません。テーブルにテキストを表示するように機能しているため、この問題は解析スクリプトとは何の関係もないと思います。写真を表示するための私のコードは次のとおりです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
Tweet *currentTweet = [[xmlParser tweets] objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
CGRect imageFrame = CGRectMake(2, 8, 40, 40);
UIImageView *customImage = [[UIImageView alloc] initWithFrame:imageFrame];
customImage.tag = 0013;
[cell.contentView addSubview:customImage];
}
UIImageView *customImage = (UIImageView *)[cell.contentView viewWithTag:0013];
customImage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString:[currentTweet pic]]]];
return cell;
}
最初に画像をロードする必要がありますか?もしそうなら、xmlを解析した後にのみ画像へのURLを取得するので、どうすればそれを行うことができますか?
助けを求めるThxAntoine