//經過數字類型建立數字對象(裝箱)spa
NSNumber *num1 = [[NSNumber alloc] initWithInteger:123];3d
NSLog(@"%@", num1);orm
NSNumber *num2 = [[NSNumber alloc] initWithDouble:12.3];對象
NSLog(@"%@", num2);it
NSNumber *num3 = [NSNumber numberWithInt:34];margin
NSLog(@"%@", num3);top
NSArray *arr1 = [NSArray arrayWithObjects:@"one", num1, nil];ant
NSLog(@"%@", arr1);co
//數字對象轉換爲基本數字類型(拆箱)數字
NSInteger value1 = [num1 integerValue];
NSLog(@"value = %ld", value1);