NSPredicate and arrays
Posted
by bend0r
on Stack Overflow
See other posts from Stack Overflow
or by bend0r
Published on 2010-03-24T10:25:53Z
Indexed on
2010/03/24
10:33 UTC
Read the original article
Hit count: 342
Hello, I've got a short question. I have an NSArray filled with Cars (inherits from NSObject) Car has the @property NSString *engine (also regarded @synthesize ...)
Now I want tu filter the array using NSPredicate
predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"(engine like %@)", searchText]];
newArray = [ArrayWithCars filteredArrayUsingPredicate:predicate];
This throws an valueForUndefinedKey error. Is the predicateWithFormat correct?
thanks for your responses
© Stack Overflow or respective owner