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

有帮助吗?

解决方案

You can make a mutable copy like this

recherchemutablearray = [[myObject filteredArrayUsingPredicate:resultPredicate] mutableCopy];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top