xcode - Adding rows to a table -
xcode - Adding rows to a table -
i have table objects added nsarray called listofconjprocedures want utilize insert command appears above top row in table add together rows table when tapping edit button in uinavigation controller , cannot find sample code. edit function looks this:
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { if ([tableview isediting]) homecoming [listofconjprocedures count] + 1; else homecoming [listofconjprocedures count]; } - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { if (editingstyle == uitableviewcelleditingstyledelete) { // delete row info source. [listofconjprocedures removeobjectatindex:indexpath.row]; [tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; } else if (editingstyle == uitableviewcelleditingstyleinsert) { // create new instance of appropriate class, insert array, , add together new row table view. } }
i don't know how proceed insert function introduce new row when edit button tapped (at bottom of posted code). give thanks in advance.
this links helps insert new row link1 link2 link3
xcode tableview
Comments
Post a Comment