标签:
NSArray,NSDictionary只能放OC对象,不能放入基本数据类型
1 void number() 2 { 3 NSNumber *number = [NSNumber numberWithInt:10]; 4 NSMutableArray *array = [NSMutableArray array]; 5 [array addObject:number]; 6 7 NSLog(@"%@", array); 8 9 NSNumber *num1 = [array lastObject]; 10 int n = [num1 intValue]; 11 }
1 NSArray *array61 = [NSArray arrayWithObjects:@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, nil];
1 int age = 100; 2 NSNumber *num = @(age);
[OC Foundation框架 - 12] NSNumber
标签:
原文地址:http://www.cnblogs.com/wvqusrtg/p/4513106.html