Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In order to delete sections from a table view, follow these steps:
First delete the section(s) in your data source, whether you are using a data model like Core Data or a dictionary/array.
Invoke the deleteSections:withRowAnimation:
instance method of UITableView
on your table view. The first parameter that you need to pass to
this method is of type NSIndexSet and
this object can be instantiated using the indexSetWithIndex: class method of
NSIndexSet class, where the
given index is an unsigned integer. Using this approach, you will
be able to delete only one section at a time. If you intend to
delete more than one section at a time, use the indexSetWithIndexesInRange: class method
of NSIndexSet to create the
index set using a range and pass that index set to the
aforementioned instance method of UITableView.