iphone - Maintain number of rows in sections: UICollectionView -


i generating seat map, have levels means sections , seats means numbers of cells in it, before there numbers of rows hold number of seats in it. uicollectionview has sections , cells in it. how manage rows. each section has cells in how show them under rows means each section have number of rows. manage display sections , cell not rows. please guide above.

thanks in advance.

this json

{ level1:  { row1: { 1: "on", 2: "on", 3: "on", 4: "on", 5: "on", 6: "on", 7: "on", 8: "on", 9: "on", 10: "on", attr: { total: "10", type: "gold"  }  },  row2: {  1: "on",  2: "on",  3: "on",  4: "on",  5: "on",  6: "on",  7: "on",  8: "on",  9: "on",  10: "on",  attr: {  total: "10",  type: "gold"  }  }  },  level3: {  row1: {  1: "on",  2: "on", 3: "on",  4: "on",  5: "on", 6: "on",  7: "on",  8: "on",  9: "on", 10: "on", attr: { total: "10", type: "silver" } } } } 

above json showing levels number of sections, question how display cells in rows.

this way doing showing 3 levels showing 1 rows cells of each level.

methods doing is:

- (nsinteger)numberofsectionsincollectionview: (uicollectionview *)collectionview { nslog(@"levels count:%d", [arrlevels count]); return [arrlevels count]; }  - (nsinteger)collectionview:(uicollectionview *)collectionview numberofitemsinsection:(nsinteger)section { nslog(@"vals count:%d", [arrseats count]); for(int i=0; i<[arrlevels count]; i++) {     if(section == i)     {         int c;         nsstring *cnt = [nsstring stringwithformat:@"%@",[arrseats objectatindex:i]];         c = [cnt intvalue];         return c;     } } return 1; } 


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -