SBJsonParser *parser = [[SBJsonParser alloc] init];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.krsconnect.no/community/api.html?method=bareListEventsByCategory&appid=620&category-selected=350&counties-selected=Vest-Agder,Aust-Agder"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
NSDictionary *object = [parser objectWithString:json_string error:nil];
NSArray *results = [parser objectWithString:json_string error:nil];
NSDictionary *dictOne = [results objectAtIndex:0];
appDelegate.books = [[NSMutableArray alloc] init];
NSArray *activitiesArray = [dictOne objectForKey:@"events"];
NSDictionary *dictTwo = [activitiesArray objectAtIndex:0];
NSLog(@"%@ - %@", [dictOne objectForKey:@"date"]);
NSLog(@"%@ - %@", [dictTwo objectForKey:@"affectedDate"]);
我想這兩個NSDictionary的值存儲在一個單一陣列如何存儲的NSDictionary值在數組中的iphone
您需要將dicOne和dictTow保存在單個數組中嗎? – Sisu
請以適當的格式發佈您的問題 – Hisenberg
好吧我以適當的格式發佈 – Ali