swift - How can numberOfRowsInSection function of TableView return multiple values for the same section? -
here, have tableview 1 section. however, have 2 cells. want numberofrowsinsection return 2 different values different rows of same section. but, can't access row in numberofrowsinsection function. can please tell me how attain this?
numberofrowsinsections should return count of cells in section, if want display 2 different type of cell (ex. celltype1 , celltype2), should logic inside
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ if (indexpath.section == 0) { if(indexpath.row == 0){ return celltype1; } if (indexpath.row == 1) { return celltype2; } } }
you can't return multiple values method, apple has not written method return multiple values
Comments
Post a Comment