I am using Realm 0.92.3 but it crashed when I have null value despite I have set the default properties. Is there any solution on this? If not I might convert using coredata as this is very important to me. The null will be random on several properties
@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
Data response:
nid = 509319;
tid = <null>;
country = my;
Error code:
-[NSNull UTF8String]: unrecognized selector sent to instance 0x10712b4c0
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull UTF8String]: unrecognized selector sent to instance 0x10712b4c0'