I try to add NSDate
to NSMutableDictionary
, and then make it a JSon
string with this methods:
NSMutableDictionary *d = [[NSMutableDictionary alloc]init];
[d setObject:[NSDate date] forKey:@"date"];
NSData *jsondata = [[CJSONSerializer serializer] serializeDictionary:d error:nil];
NSString *requestBody = [[[NSString alloc] initWithData:jsondata encoding:NSUTF8StringEncoding] autorelease];
And i have couple of issue:
1) The jsondata
is nil, and then the requestBody
is nil too.
2) The [NSDate date]
getting me wrong date, not like the date in my iPhone:
2013-01-19 11:48:46 +0000
Any help with this issue?
Edit:
When i print the error i got this msg:
Error Domain=TODO_DOMAIN Code=-1 "Cannot serialize data of type '__NSDate'" UserInfo=0x177850 {NSLocalizedDescription=Cannot serialize data of type '__NSDate'}
It's not possible to do it?