setAttributedStringForNil:
数字フォーマッタのnilの時の属性付き文字列をセットします
-(void)setAttributedStringForNil:(NSAttributedString *)newAttributedString:
解説
数字フォーマッタのnilの時の属性付き文字列をセットします。
初期設定は空の文字列です。
返り値
( void )
なし
引数
( NSAttributedString * )newAttributedString
属性付き文字列
フレームワーク
Foundation
クラス
NSNumberFormatter
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSNumberFormatter *numFormat = [[[NSNumberFormatter alloc] init] autorelease] ; [numFormat setAttributedStringForNil:[[NSAttributedString alloc] initWithString:@"nil!!!"]]; [numFormat setNegativeFormat:@"-#,##0.00"]; [myOutlet setFormatter:numFormat]; NSLog([[[myOutlet formatter] attributedStringForNil] string]); } @end