Realm 0.92.3 を使用していますが、デフォルトのプロパティを設定しているにもかかわらず、null 値があるとクラッシュしました。これに関する解決策はありますか?そうでない場合、これは私にとって非常に重要であるため、coredata を使用して変換する可能性があります。null はいくつかのプロパティでランダムになります
@interface WatchlistNews : RLMObject
@property NSString *nid;
@property NSString *tid;
@property NSString *country;
@end
@implementation WatchlistNews
+ (NSString *)primaryKey {
return @"nid";
}
+ (NSDictionary *)defaultPropertyValues {
return @{@"nid" : @"", @"tid": @"", @"country": @""};
}
@end
データ応答:
nid = 509319;
tid = <null>;
country = my;
エラーコード:
-[NSNull UTF8String]: unrecognized selector sent to instance 0x10712b4c0
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull UTF8String]: unrecognized selector sent to instance 0x10712b4c0'