iOS OC 快速创建 数组 字典

    
    // 数组
    NSArray *arr = @[@"1",@"2",@"3",@"4"];
    // 数组中有数组
    NSArray *arr2 = [NSMutableArray arrayWithArray:@[
                                                   @[@"A1",@"B1",@"C1",@"D1"],
                                                   @[@"A2",@"B2",@"C2",@"D2"],
                                                   @[@"A3",@"B3",@"C3",@"D3"]
                                                   ]];
    // 字典
    NSDictionary *dict = @{@"title":@"这里是title",
                           @"desc":@"这里是desc"};
    // 字典 数组 混合
    NSArray *arrAndDict = @[
                            @{@"indexTitle": @"A",@"data":@[@"A1", @"A2", @"A3"]},
                            @{@"indexTitle": @"D",@"data":@[@"D1", @"D2", @"D3"]},
                            @{@"indexTitle": @"F",@"data":@[@"F1", @"F2", @"F3"]}
                            ];

你可能感兴趣的:(iOS OC 快速创建 数组 字典)