数组新添加法

一、数组新添加法

NSMutableArray  *mArray = [NSMutableArray new];

for (int i =0; i <3; i ++) {

    [mArray addObject:@[@"one",@"tow",@"three"][i]];

}


输出mArray@"one",@"tow",@"three"


二、JSON取数据 valueForKeyPath

NSDictionary *tempDict = @{@"expand3":@{@"res":@{@"time":@"2013-10-31"}}};

NSLog(@"time = %@",[tempDict valueForKeyPath:@"expand3.res.time"]);


输出  time = 2013-10-31



你可能感兴趣的:(数组新添加法)