how to show image in table cell through json parsing

前端 未结 4 1497
没有蜡笔的小新
没有蜡笔的小新 2021-01-26 14:51
NSURL *url = [NSURL URLWithString:@\"yourimage\"];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];
<         


        
4条回答
  •  孤街浪徒
    2021-01-26 15:03

    This works for me:

    NSURL *url = [NSURL URLWithString:[aTweet objectForKey:@"profile_image_url"]];
    NSData *imgData = [NSData dataWithContentsOfURL:url];
    cell.imageView.image = [UIImage imageWithData:imgData];
    

提交回复
热议问题