iphone - Displaying new data under selected row in a table view -
i have table view on screen has 5 rows when view opened.
when select row, new rows added below selected row (new rows = array count other view).
when select row again, has display 5 rows again. in table view when select row rows added based on array count. again click same row has display 5 rows again. how can that?
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return currentrows; } if(selectedindex == 0) { (int j=1;j<=[passionarray count];j++) { currentrows = currentrows + 1; nslog(@"numberofrowsatindex %d",currentrows); nsindexpath *indexpath1 = [nsindexpath indexpathforrow:j insection:0]; [tableview insertrowsatindexpaths:[nsarray arraywithobjects:indexpath1, nil] withrowanimation:uitableviewrowanimationfade]; selected=yes; }
are reloading table , forcing go through data source again refresh actual view? may elsewhere in code cannot see, after augmenting data source reflect new row count, call [tableview reloaddata];
good luck!
Comments
Post a Comment