The error message indicates that searchString
is nil
in
NSPredicate *filterPredicate = [NSPredicate
predicateWithFormat:@"(workoutName CONTAINS[cd] %@)", searchString];
If the intention is to display all objects if no search string is given, you should just not assign a predicate to the fetch request in that case:
if ([searchString length] > 0) {
NSPredicate *filterPredicate = [NSPredicate
predicateWithFormat:@"(workoutName CONTAINS[cd] %@)", searchString];
[request setPredicate:filterPredicate];
}