I have an UITableView with sections and many rows.
I don’t need a detailed search, going through all cells in the tableview.
All the sections titles are contained inside a NSMutableArray.
Is there a simple way to search only the sections titles of an UITableView, disregarding the cell contents?
Thank you!
See this Apple Sample implementation – notice the function named:
Here, instead of:
You can put:
Also change implementation of this function as per your need, you should be done. (like, you can ignore the scope things as you only want to search for section header which is nothing but a simple string) This function is simply search routine which you can change as you wish. It is actually called by following delegate function – this you do not want to change:
Note that this control I am suggesting is an in-built tableview control that comes with search bar already. It is:
If you added search bar on your own, you would need to add both these delegates to your UITableView .h file like I did above. If you would rather copy Apple’s example implementation, no worries.