I'm trying a basic test of sorting an NSManagedObject subclass. I set up a basic subclass "TestClass" with two attributes: stringField
and numberField
. They use the standard Obj-C 2.0 accessor protocol:
@interface TestClass : NSManagedObject
@property (retain) NSString *stringField;
@property (retain) NSNumber *numberField;
@end
@implementation TestClass
@dynamic stringField;
@dynamic numberField;
@end
When I try to fetch instances of this entity, I can fetch based on either attribute. However, if I use a sort descriptor, the numberField
is said to not be KVC-compliant.
Within the model, I set the numberField
to Int64, but I'm confused. I thought the wrapper (NSNumber) would handle the KVC problem. What do I need to do to make this work?