I have below snippet that I am supposed to create in objective-c.
{
"expression": "???=n1+n2+n3+n4",
"terms": [
{
"name": "termsTitle",
"term": [
{
"name": "answer",
"value": "???"
}
]
}
]
}
Here's my attempt to create it
NSMutableArray *terms= [[NSMutableArray alloc] init];
NSArray *keysTerms = [[NSArray alloc] initWithObjects:@"name", @"term", nil];
NSMutableArray *term= [[NSMutableArray alloc] init];
NSArray *objectsTerms = [[NSArray alloc] initWithObjects:@"answer",term, nil];
NSDictionary *termsDict = [[NSMutableDictionary alloc] initWithObjects:objectsTerms forKeys:keysTerms];
[terms addObject:termsDict];
NSDictionary *statement = [[NSDictionary alloc]
initWithObjectsAndKeys:expression,@"expression",
terms,@"terms",
nil];
I think I am close but for some reason, this is not working for me. I would appreciate any help. Thanks in advance.