I've just discovered Realm and started working with it in objective-c.
I'm trying to get the objects where create_date
before specific date and time
I read this answer on StackOverflow, So i tried this :
NSString *dateString = @"2015-06-03 08:24:00";
NSDateFormatter * dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *newDate = [dateFormatter dateFromString:dateString];
RLMRealm *realm = [RLMRealm defaultRealm];
NSString *_where = [NSString stringWithFormat:@"create_date < '%@'", newDate];
RLMResults *results = [database_articles objectsInRealm:realm where:_where];
but i'm getting the following error:
'Expected object of type date for property 'created' on object of type 'database_articles', but received: 2015-06-03 05:24:00 +0000'
So how can I pass NSDATE in a query in Realm ??
Thanks in advance ..