I have this code that where I would normally use one line:
if (tableView == self.searchDisplayController.searchResultsTableView)
{
NSLog(@"Configuring cell to show search results");
shoppingList = [self.searchResults objectAtIndex:indexPath.row];
cell.textLabel.text = shopList.name;
cell.textLabel.text = shopList.type;
cell.textLabel.text = shopList.price;
cell.textLabel.text = shopList.occasion;
}
The reason I have this is that I am implementing a scope under my search bar. Now the scope works, when I type in a name I would expect to see the name when I select the first scope which is the name of the product.
What is happening however is that it shows what is under occasion, since it is the last one in the list (I pressume). So when I type in the name of a product it comes up with the matching occasion instead of the name of the product.
How do I set it up that it shows what I select in the scope?
I have implemented the following method, to make the scope work correctly, just the labels are not coming up right, which is affected in the tableView section code above.
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
Any help is great:-) Thanks.