numberWithShort:
shortの数字オブジェクトを作って返します
+(NSNumber *)numberWithShort:(short)value:
解説
shortの数字オブジェクト(NSNumber)を作って返します。
shortは2バイトの整数値
- 32767から32767まで
返り値
( NSNumber * )
NSNumber
引数
( short )value
short値
フレームワーク
Foundation
クラス
NSNumber
Class Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSNumber * num = [NSNumber numberWithShort:32767]; NSLog(@"%%hi = %hi",[num floatValue]); NSLog(@"%d byte(s)",sizeof[num shortValue]); [info setIntValue:[num shortValue]]; } @end