Source Code
// 宣告array NSMutableArray *words = [NSMutableArray array]; // 宣告dictionary NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"Title 01", @"title", @"Explain 01", @"explain", nil]; // 將dict新增至array裡 [words addObject:dict]; // print出dict中所有資料 for (id key in dict) NSLog(@"key: %@ value: %@", key, [dict objectForKey:key]); // print出Array中所有資料 for (NSInteger i=0; i < [words count]; i++) NSLog(@"%@", [words objectAtIndex:i]); // print Array有幾筆資料 NSLog(@"Words count : %i", [words count]);Result
See Also
NSDictionary Class Reference
NSMutableArray Class Reference