uitableviewios6.1で画像を読み込むにはどうすればよいですか。
現在 SDWebImagehttps ://github.com/rs/SDWebImageを使用していますが、動作しますが、画像が読み込まれない場合があります。
私が使用しているライブラリよりも優れたライブラリは他にありますか?私はiOSの初心者であり、それは私に大いに役立つでしょう。
前もって感謝します。
これは私が今使っているコードです:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier] autorelease];
}
// Here we use the new provided setImageWithURL: method to load the web image
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
cell.textLabel.text = @"My Text";
return cell;
}