I'm currently learning iOS development. Unfortunately the course I've signed up for is based on iOS 7 and doesn't seem to have any support. I have Xcode 7 however and have become very stuck on trying to implement a search bar in a table view. I've been searching for answers on how to fix the 'searchDisplayController' deprecation, and while there is information out there, being new to Objective-C, I haven't worked out how to fix my issue.
I have a very basic TableView app that simply displays the months of the year in a TableView. I've added the "Search Bar and Search Display Controller" to the TableView. Here is the first part of my code where Xcode tells me that 'searchDisplayController' is deprecated within 'TableViewController.m':
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
if (tableView == self.searchDisplayController.searchResultsTableView) {
return [_filteredResults count];
}
else {
return [_monthsOfTheYear count];
}
}
I would really appreciate it if someone could let me know what I need to do instead or to point me to a tutorial that could help me to understand it.
Thank you!