initWithChar:
charの数値オブジェクトを初期化して返します
-(id)initWithChar:(char)value:
解説
charの数値オブジェクト(NSNumber)を初期化して返します。
返り値
( id )
NSNumber
引数
( char )value
char値
フレームワーク
Foundation
クラス
NSNumber
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //charの数値オブジェクトを作成 NSNumber *num = [[[NSNumber alloc] initWithChar:'a'] autorelease]; NSLog(@"%d",[num charValue]); NSLog(@"%d byte(s)",sizeof[num charValue]); } @end