Hi,
I've a model object that extends from NSObject called column. Column has two fields, properties and data. Properties is an NSDictionary that stores arbitrary key/value pairs while data is an array.
Columns come in arrays and I need to sort them by a value I know will always be in properties, a value with the key ordinal_position.
I'm using the following code to sort but it always fails because there is no "ordinal_position" in the model object, only in the properties of the model object:
NSArray *unsortedArray = [resultStore allValues];
NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"ordinal_position" ascending:YES] autorelease];
NSArray *sortedArray = [unsortedArray sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
How can I tell NSSortDescriptor to look for the property in a dictionary in the model object?