json.frameworkを使用してjsonメッセージを読み込もうとしています。メッセージは、会議の詳細のネストされたコレクションです。私の望みは、すべての会議の考えを繰り返し、メッセージから読み取った詳細を使用してローカルの会議オブジェクトを作成することです。jsonの結果に含まれている15の会議のリストを取得するように見えますが、結果から個々の値を取得することはできません。
これが私のサンプルコードです。このテストにサーバーを関与させる必要がないように、jsonメッセージにファイルを使用しています。jsonメッセージはここからダウンロードできます。
-(void)TestParse:(NSString *)response
{
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"conference_calls" ofType:@"json"];
NSString *fileContent =[[NSString alloc]initWithContentsOfFile:filePath];
parser = [SBJsonParser new];
NSArray *results = [parser objectWithString:fileContent];
NSLog(@"Number of itmems in the results: --> %i", [results count]);
for(NSDictionary *conf in results){
//Load local objects with the values of the Conf info.
NSLog(@"This the description %@ ",[c valueForKey:"phone_number"]);
NSLog(@"Number of Items in Dic: %i",[conf count]);
NSLog(@"File contents: %@",[conf description]);
}