【发布时间】:2017-05-18 10:14:24
【问题描述】:
是否可以将枚举用作我的模型的属性?我目前有这样的课程:
typedef NS_ENUM(NSUInteger, ListType) {
ListTypeDay,
ListTypeWeek,
ListTypeMonth,
ListTypeYear,
ListTypeCustom
};
@interface ListItem : RLMObject;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, assign) ListType itemType;
@property (nonatomic, assign) BOOL isFinish;
@property (nonatomic, assign) NSTimeInterval targetTime;
@end
RLM_ARRAY_TYPE(ListItem)
终端输出:
由于未捕获的异常“RLMException”而终止应用程序,原因:“无法使用不兼容的类型保留属性“itemType”。添加到被忽略的PropertyNames:要忽略的方法。'
【问题讨论】:
标签: ios objective-c database realm