uitableview - delete particular tableview item in SWRevealViewController in objective C -


hi how remove particular table view cells in swrevealviewcontroller .my table view cells hard coded in story board.

-(cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath*)indexpath {    if(indexpath.row==2)    {       return 0.0;    }    if(indexpath.row==3)    {       return 0.0;    }       return 75; } 

while running first time messed up.once click particular cell working properly. 

here screen shot: https://i.stack.imgur.com/yunoi.jpg

do follows

1.create number of dynamic cells per needs(how items want show).

2.give different identifier of cells.

3.make array of identifiers of of yours cell in sequence in want show cells. identifierarray[] in case.

4.then in numberofitems insection, return identifierarry.count.

5.simply in cellforrow atindexpath, dequeue cell identifier: identifierarray[indexpat.row].

6.if want delete row remove identifier identifierarray identifierarray.removeobject[position]. position position of item in array.

7.and after removing identifier array call tableview.reloaddata method.

hope you. note: if solve problem not forget mark accepted checking tick mark.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -