아래 객석에서 작성해야 할 스 니펫이 있습니다. c.objective-c로 중첩 된 json 객체를 생성합니다.
{
"expression": "???=n1+n2+n3+n4",
"terms": [
{
"name": "termsTitle",
"term": [
{
"name": "answer",
"value": "???"
}
]
}
]
}
는 여기에게 내가 가까이 모르지만, 어떤 이유로,이 나를 위해 작동하지 않는 생각
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];
을 만들 내 시도입니다. 나는 어떤 도움을 주셔서 감사합니다. 미리 감사드립니다. 당신은 당신이 더 자세한 코드를 작성할 필요가 구조에 약간의 문제가있는 경우
[의 NSNumber numberWithInteger : 용어]이 어떻게 할 수 있습니까? 용어는 정수가 아니기 때문에 배열입니다. – Alexi
죄송합니다. – ilteris