Vì vậy, tôi đã có đoạn mã sau:UITableViewCell IMAGExem không hiển thị
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"FriendsCell";
FriendData * fd = [self.friendsDataSource_ objectAtIndex:indexPath.row];
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
[cell.imageView setImageWithURL:[NSURL URLWithString:fd.imageUrl_]];
[cell.imageView setFrame:CGRectMake(0, 0, 30, 30)];
[cell.textLabel setText:fd.name_];
return cell;
}
Tuy nhiên, tôi không nhìn thấy những IMAGExem trong tế bào. Tôi đang làm gì sai?
chúng ta hãy xem phương pháp -setImageWithURL bạn – shabbirv
Cùng với nhìn thấy 'setImageWithURL: ', bạn có chắc rằng **' fd.imageUrl_' ** không phải là con số không? – WrightsCS
có url hợp lệ và không phải là số không – adit