I've looked at using an enum typedef recently, and stored it as an NSNumber in Core Data. I implemented my own subclass of NSManagedObject and created a property for my type. In the accessors I then converted to and from NSNumber:
- (MyTypedef)type {
NSNumber *value = [self primitiveValueForKey:@"type"];
return [value integerValue];
}
- (void)setType:(MyTypedef)aType {
NSNumber *value = [NSNumber numberWithInteger:aType];
[self setPrimitiveValue:value forKey:@"type"];
}
In the end I didn't go with this solution, but it worked fine for me then (on the iPhone). Not sure if the above code is absolutely correct - I justed typed it into this browser window.
There is probably more work required if you want to use KVO etc. and you might want to do some error checking in the accessor method to check whether what you get back in the NSNumber is actually valid in the enum.