So my JSON request should look something like:
{
"MyDictionary" : ["some values"],
"RegularValue" : "regularValue",
}
So what I currently have done is:
NSDictionary *myDict = @{@"Blah" : @"1", @"Yadayada" : @"2"};
NSDictionary *jsonDict = @{"MyDictionary" : myDict, "RegularValue" : "someValue"};
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:kNilOptions error:&error];
So this works fine. The problem I have is, instead of manually creating MyDictionary, what I want to do is use a custom sublcass of NSObject and serialize that to JSON. I basically have to manually create the NSDictionary for the properties of my custom NSObject and put that in the NSJSONSerialization method. But I was wondering if there was a better way to do this? Thanks.