I have Core Data and one of my entity property is object of type Date (i assume it is NSDate).
From JSON response i got date in following format:2016-01-09 22:33:33
When mapping, i'm setting values in my NSManagedObject like that:
[item setValue:[obj valueForKey:JS_DATE] forKey:CD_DATE];
Where macros are simply string, referring to entity name or json response key for date.
App throw an exception on that, i assume i want to save NSDate with different format. How to fix that?
Thanks.
NSDateFormatter
to transform theNSString
object intoNSDate
one, or change the property type toNSString
, but you may loose some good feature for predicates withNSDate
(like <, =<, > or >=). – Larme