Filter NSArray using NSPredicate

Hello Here I shows how to filter data from the NSArray using searchBar value insert that time relevant data shows into UITableView.

First of all lets we get one UISearchBar for inserting value into them and then after according then string value relevant data display into below UITableView.It’s very easy and very sort trick to search data from NSArray.
Step 1: Put UISearchBar and give delegate to UIViewController’s finder.
step 1

Step 2: Put UITableView and give delegate and datasource toUIViewController’s finder.

Step 2


Step 3 : Adding missing constraint click on red error and resolve all that.
Then assign appropriate IBOutlets to controller like below.

Now Delegate & Datasource UISearchBar and UITableView from storyboard to viewcontroller’s finder.

Step 4: Assign NSArray values.

Step 5: Below is code for the Delegate methods of UITableView and UISearchBar

Also You Can Download sample code from Here.

This entry was posted in iPhone Development by Nimit Parekh. Bookmark the permalink.

About Nimit Parekh

Hey ! I am Nimit S. Parekh a passionate mobile application developer from India.. I am always hunting for better knowledge in iOS. I am looking forward to be a good app & game developer. I keep on sharing my knowledge @ as soon as I get spare time for it. I would love to hear your personal feedback about this blog.

Leave a Reply

Your email address will not be published. Required fields are marked *