I\'m getting this exception when I try to JSON encode NSDate object.I believe NSDate is not compatible for JSON encoding. but I must encode the date.Any solutions?
The simplest way to store and retrieve a NSDate object in JSON would be to use the timeIntervalSince1970 property of NSDate.
The returned NSTimeInterval (double) is pretty standard and can easily be converted back to a NSDate object using:
NSDate dateWithTimeIntervalSince1970:<#(NSTimeInterval)#>