大家好,我创建了一个json请求:
for (int i=0; i<= [urls count]-1; i++) {
self.items=[[NSMutableDictionary alloc] init];
[self.items setObject:[names objectAtIndex:i] forKey:@"results"];
[self.items setObject:[urls objectAtIndex:i] forKey:@"URL"];
[self.list addObject:_soccerList];
}
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:_list
options:0
error:&error];
self.results=[NSJSONSerialization
JSONObjectWithData:jsonData
options:0
error:&error];
但是我需要添加这个标题到json请求中,其中添加条目计数。不知道如何实现?
{
"resultCount":50,
"results": [
/// json content
]
}