述語を作成しようとしていますが、エラーが発生します。エラー 'NSInvalidArgumentException' が発生します。理由: 'フォーマット文字列 "title contains[cd] @%" を解析できません'
request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"title" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]];
NSString *predicateString=[NSString stringWithFormat:@"title contains[cd] @% ",searchText];
request.predicate = [NSPredicate predicateWithFormat:predicateString];//error here
そして、このように
request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"title" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]];
request.predicate = [NSPredicate predicateWithFormat:@"title contains[cd] @%",searchText];//error here