读书人

数组新增添法

发布时间: 2013-10-23 11:39:13 作者: rapoo

数组新添加法

数组新添加法

NSMutableArray *mArray = [NSMutableArray new];

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

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

}


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


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

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


输出@"2013-10-31"


读书人网 >移动开发

热点推荐