0

[NSData datawithContentsOfURL:] で指定した URL が (一見) 正しいのに、UIImage がその URL をロードしていません。

ここに私の configureCell: メソッドがあります:

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath 
{
  NSString *url = [photoUrls objectAtIndex:indexPath.section]; 

  cell.imageView.image = [UIImage imagewithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];  
}

「photoUrls」配列の内容は次のとおりです (箇条書きを除く)。

(

)

4

2 に答える 2

0

URL が有効な画像を指していません。私が見るのはすべてです"Not found. Back to facebook"。への呼び出し[NSData dataWithContentsOfURL:]はデータを取得しますが、データが有効な画像を表していないため、 の[UIImage imageWithData:]生成に失敗します。UIImage

于 2013-11-04T04:26:27.140 に答える