NSPredicate-Abfrage, die keine bestimmte Zeichenfolge enthält

Schaute hoch und niedrig für diese aber nicht finden können, meine Antwort. Ich bin auf der Suche zu query-core-Daten für alle Datensätze, die NICHT gleich einer angegebenen Zeichenfolge. Zum Beispiel werden alle Datensätze, die nicht gleich die aktuelle session-ID. Ich habe versucht, diese ohne Erfolg:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"listingID != %@", [sitListingID objectAtIndex:i]];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ NOT CONTAINS[cd] %@",@"listingID", [sitListingID objectAtIndex:i]];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ NOT CONTAINS %@",@"listingID", [sitListingID objectAtIndex:i]];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"listingID NOT like %@", [sitListingID objectAtIndex:i]];

Nichts funktioniert.HEEEEELP!!!
----------------------------------------------------- mehr code

NSFetchRequest *request = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"ListingRecord" inManagedObjectContext:context];
    [request setEntity:entity];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"sessionID <> %@", uniqueSessionListings];
    [request setPredicate:predicate];
    NSError *error = nil;
    NSMutableArray *mutableFetchResults = [[context executeFetchRequest:request error:&error] mutableCopy];

InformationsquelleAutor der Frage sangony | 2012-09-21

Schreibe einen Kommentar