Exception thrown in NSOrderedSet generated accessors

后端 未结 25 2551
天涯浪人
天涯浪人 2020-11-22 09:07

On my Lion app, I have this data model:

\"enter

The relationship subitem

25条回答
  •  轮回少年
    2020-11-22 09:37

    Instead to making a copy I suggest to use the accessor in NSObject to get access to the NSMutableOrderedSet of the relationships.

    - (void)addSubitemsObject:(SubItem *)value {
          NSMutableOrderedSet* tempSet = [self mutableOrderedSetValueForKey:@"subitems"];
          [tempSet addObject:value];
     }
    

    e.g. the Core Data Release Notes for iOS v5.0 refer to this.

    In a short test it worked in my application.

提交回复
热议问题