More for my interest than anything else.
If you have an Class defined like so...
MyClass
-------
NSString *name
And you put a lot of them into an array (or mutable array). Then you can use a predicate like this...
[NSPredicate predicateWithFormat:@"name = %@", someValue];
to filter the array so that it only contains objects whose names are the value given.
Or sort descriptor like so...
[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
to sort the array by the name field in ascending order.
My question is, if you have an array of strings (or of NSNumbers) can you use similar "format" predicates?
Say for instance you had the array...
@[@"Cat", @"Bat", @"Dog", @"Cow"];
Could you use a "predicateWithFormat" to filter this array of a "sortDescriptorWithKey" to sort it?
I know you can use blocks but just wondering if this is possible?