On my Lion app, I have this data model:
The relationship subitem
Received the same error, @LeeIII solution worked for me (thanks!). I suggest slightly modify it:
Content of Item+category.m
:
#import "Item+category.h"
@implementation Item (category)
- (void)addSubitemsObject:(SubItem *)value {
if ([self.subitems isKindOfClass:[NSMutableOrderedSet class]]) {
[(NSMutableOrderedSet *)self.subitems addObject:value];
} else {
NSMutableOrderedSet* tempSet = [NSMutableOrderedSet orderedSetWithOrderedSet:self.subitems];
[tempSet addObject:value];
self.subitems = tempSet;
}
}
@end