我正在尝试将Realm用作应用程序内的移动数据库。所以我从RLMObject中继承了我的模型类,并在编译代码时遇到了这个错误。我不知道为什么会发生这种情况,因为我的模型类中没有任何NSArray属性: - (
Terminating app due to uncaught exception 'RLMException', reason: 'RLMArray properties require a protocol defining the contained type - example: RLMArray<Person>.'
编辑: - 示例代码
@interface GSShow : RLMObject
@property (strong, nonatomic) NSNumber<RLMInt> *showId;
@property (strong, nonatomic) NSNumber<RLMInt> *numberOfTimesRated;
@property (copy, nonatomic) NSString *trailerUrl;
@property (copy, nonatomic) NSString *backdropUrl;
@property (copy, nonatomic) NSString *posterUrl;
@end
重要的是,我还没有在我的代码中写过任何关于Realm Api的用法。
错误日志: -
*** Terminating app due to uncaught exception 'RLMException', reason: 'RLMArray properties require a protocol defining the contained type - example: RLMArray<Person>.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001083c6d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a0bbdeb objc_exception_throw + 48
2 Realm 0x000000010957ec85 -[RLMProperty setTypeFromRawType] + 1813
3 Realm 0x000000010957fd32 -[RLMProperty initWithName:indexed:property:] + 322
4 Realm 0x000000010955edd5 +[RLMObjectSchema propertiesForClass:isSwift:] + 1461
5 Realm 0x000000010955cf79 +[RLMObjectSchema schemaForObjectClass:] + 809
6 Realm 0x0000000109656e7f +[RLMSchema registerClasses:count:] + 1663
7 Realm 0x0000000109659725 _ZZ25+[RLMSchema sharedSchema]ENK3$_0clEv + 517
8 Realm 0x000000010965950b _ZNSt3__117__call_once_proxyINS_5tupleIJOZ25+[RLMSchema sharedSchema]E3$_0EEEEEvPv + 91
9 libc++.1.dylib 0x0000000107d0310b _ZNSt3__111__call_onceERVmPvPFvS2_E + 117
10 Realm 0x000000010965756c +[RLMSchema sharedSchema] + 524
11 Realm 0x000000010955932b +[RLMObjectBase sharedSchema] + 43
12 Realm 0x0000000109556b1b _ZL26RLMInitializedObjectSchemaP13RLMObjectBase + 123
13 Realm 0x0000000109556a43 -[RLMObjectBase init] + 115
14 Realm 0x000000010955487b -[RLMObject init] + 59
15 Goodshows 0x000000010749d635 -[GSShow initWithAttributes:] + 85