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?
Have you tried ?
updateDate = [NSNumber numberWithFloat:[[NSDate date] timeIntervalSince1970]];
As Described Here : SDK not supporting NSDate objects
Follow these Steps :
1. Convert the Date in JSON Format :
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init]autorelease];
[formatter setDateFormat:@"Z"];
NSString *updateDate = [NSString stringWithFormat:@"/Date(%.0f000%@)/", [[NSDate date] timeIntervalSince1970],[formatter stringFromDate:[NSDate date]]];
2. Embed In some array and POST the array.