ios - How to Load JSON Array First Object at TableViewFirst Section and Remaining object at Second Section? -



ios - How to Load JSON Array First Object at TableViewFirst Section and Remaining object at Second Section? -

i newbie in ios development. create application contain json info want show json array first object in tableview first section , remaining object of info shown in tableview sec section , tableview each section contain different tableviewcell code load different cell want info not loaded in each cell

here code first section is

-(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section == 0) { static nsstring *cellidentifierone=@"cellone"; custumcell *cellone =[tableview dequeuereusablecellwithidentifier:cellidentifierone]; if (cellone == nil) { nsarray *nibone=[[nsbundle mainbundle]loadnibnamed:@"custumcell" owner:self options:nil]; cellone=[nibone objectatindex:0]; } { [cellone.spinner startanimating]; nsdictionary *dict = [self.imagearray objectatindex:1]; nsstring *img2=[dict valueforkey:@"front_image"]; [cellone.storeimage sd_setimagewithurl:[nsurl urlwithstring:[img2 stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]] placeholderimage:[uiimage imagenamed:@"setting.png"] options:sdwebimagehighpriority completed:^(uiimage *image, nserror *error, sdimagecachetype cachetype, nsurl *imageurl) { [cellone.spinner stopanimating]; cellone.spinner.hideswhenstopped=yes; }]; nsstring *title=[dict valueforkey:@"title"]; cellone.titlelabel.text=title; nsstring *shrtdescrpt=[dict valueforkey:@"short_description"]; cellone.shortdescriptionlabel.text=shrtdescrpt; } homecoming cellone; } }

and when run application contain error in line

nsdictionary *dict = [self.imagearray objectatindex:1];

please give me solution , code write sec section load array remaining object.

and tableview row , section code is

-(nsinteger)numberofsectionsintableview:(uitableview *)tableview { homecoming 2; } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { if (section == 0) { homecoming 1; } else { homecoming self.imagearray.count - 1; } }

ios objective-c json uitableview

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -