0
votes

My code:

NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"File" inManagedObjectContext:[self managedObjectContext]];
    [fetchRequest setEntity:entity];
    cellText = @"Crysis 3 - 'The Nanosuit' Gameplay Trailer";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:cellText];
    [fetchRequest setPredicate:predicate];

And after build i have error

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "Crysis 3 - 'The Nanosuit' Gameplay Traile"'

How to fix it?

1

1 Answers

1
votes

You're passing some DB value text to predicate with format. See NSPredicate reference. It requires a string in a very structured format:

It's going to be something like: @"gameName like Crysis 3"