Objective-C UITableView cell image

前端 未结 2 1743
终归单人心
终归单人心 2021-01-24 12:37

So I have a UITableView of Facebook Friends and for a cell I want to add the image to it.

When I try the following code:

cell.imageView.         


        
相关标签:
2条回答
  • 2021-01-24 13:08

    replace: (@"http://graph.facebook.com/%@/picture", thisFriend.friendID) with this:

    [NSString stringWithFormat:@"http://graph.facebook.com/%@/picture", thisFriend.friendID];
    

    Looks like you just forgot the method for formatting a string.

    0 讨论(0)
  • 2021-01-24 13:08

    try

    cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:
        [NSURL URLWithString:[NSString stringWithFormat:@"http://graph.facebook.com/%@/picture", thisFriend.friendID]]]];
    
    0 讨论(0)
提交回复
热议问题