相关疑难解决方法(0)

NSOrderedSet生成的访问器抛出异常

在我的Lion应用程序中,我有这个数据模型:

在此输入图像描述

subitems里面的关系Item 是有序的.

的Xcode 4.1(建4B110)为我创建的文件Item.h,Item.m,SubItem.hSubItem.h.

以下是内容(自动生成)Item.h:

#import <Foundation/Foundation.h>

#import <CoreData/CoreData.h>

@class SubItem;

@interface Item : NSManagedObject {
@private
}

@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSOrderedSet *subitems;
@end

@interface Item (CoreDataGeneratedAccessors)

- (void)insertObject:(SubItem *)value inSubitemsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromSubitemsAtIndex:(NSUInteger)idx;
- (void)insertSubitems:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeSubitemsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInSubitemsAtIndex:(NSUInteger)idx withObject:(SubItem *)value;
- (void)replaceSubitemsAtIndexes:(NSIndexSet *)indexes withSubitems:(NSArray *)values;
- (void)addSubitemsObject:(SubItem *)value;
- (void)removeSubitemsObject:(SubItem *)value;
- (void)addSubitems:(NSOrderedSet *)values;
- …
Run Code Online (Sandbox Code Playgroud)

cocoa core-data xcode4

364
推荐指数
11
解决办法
5万
查看次数

标签 统计

cocoa ×1

core-data ×1

xcode4 ×1