Reputation: 412
Hello,
I search solution for my problem but I didn't found an answer.
My problem is that UISearchDisplayController no display anything.
I think is this part of code :
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"name contains[c] %@", searchText];
recherchemutablearray = [myObject filteredArrayUsingPredicate:resultPredicate];
}
Because recherchemutablearray with [myObject filteredArrayUsingPredicate:resultPredicate] return an array so as xcode say the pointer are incompatible...
I don't understand how i can do filteredUsingPredicate:resultPredicate but to return a NSMutableArray.
After, it possible that there is an another problem in search fonction part code but I need to resolve this first.
Thanks
Upvotes: 1
Views: 1938
Reputation: 34829
You can make a mutable copy like this
recherchemutablearray = [[myObject filteredArrayUsingPredicate:resultPredicate] mutableCopy];
Upvotes: 3