how to show image in table cell through json parsing

前端 未结 4 1501
没有蜡笔的小新
没有蜡笔的小新 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:06

    FirstLy You need To parse That JSON file In Your iOS Application. I guess You get Some URL from That JSON for The Image So You need To Download Image Form That Prased URL and Can set That IMage Over ANy UIIMageView and you can set That UIIMageView to The Content View Of UITablViewCell.

    Here You Need To Just Manage One THing Suppose You have Many Images To be Downlaod Form The Particular path.So You should Take Care of The UI Interaction also Here Is Good Example Of How TO download Images form The URL and set That DownLoaded Image Over The UIImageView and set That UIImageView on to the ContentView of UITableViewcell.In this Example you'll also see The Way of How Can you Add The These Images Over The TableViewcEll.

    Here Is The Link For That Example

    I hope It may help You.

提交回复
热议问题