Quote:
Originally Posted by devcoder
i doesn't means the Indenting .... What i want to know is how can i add and delete the rows if appropriate rows are selected ... like expanding and collapsing ...
|
So you want each category to be empty initially, with a disclosure triangle on it? Then, when the user taps on it, you want it to "open up" and display the data for that category?
We do something very much like that in the help system for our apps "Kevin and Kell" and "Save My Place". (Save My Place is only $0.99. You might want to download it to see if its help (info) screen is doing what you want)
What we do is create an array of booleans "section is open" for each section of items.
If a section is not open, we return 1 in response to the numberOfRowsInSection data source call for that section.
(The only row is the section heading with the disclosure button.)
If the user taps a section, we change a flag to indicate that that section is now "open," and insert the extra rows for that section into the table view using the insertRowsAtIndexPaths:withRowAnimation: method.