Take the 2-minute tour ×  so I am happily slamming data into my
system using JSON and setValuesForKeysWithDictionary until I run
into an object that has an NSDate property.  The JSON contains
dates with the following format:  BackOrderDate:
"2011-03-15T00:00:00"  This gives me an error:
'NSInvalidArgumentException', reason: 'Unacceptable type of
value for attribute: property = "BackOrderDate"; desired type =
NSDate; given type = __NSCFString; value = 2011-03-15T00:00:00
I am using JSON.NET with MVC and the following settings with it:
JsonSerializerSettings serializerSettings = new
JsonSerializerSettings(); serializerSettings.Converters.Add(new
Newtonsoft.Json.Converters.IsoDateTimeConverter()); string json
= JsonConvert.SerializeObject(objects, Formatting.None,
serializerSettings); return Content(json);  Any ideas on how to
deal with this issue? I do not want to lose the use of
setValuesForKeysWithDictionary since it so fricking fast.
share|improve this question  1 Answer 1  up vote 2 down vote
accepted