setAllowsFloats:
数字フォーマッタは小数点値を扱うかをセットします
-(void)setAllowsFloats:(BOOL)flag:
解説
数字フォーマッタは小数点値を扱うかをセットします。
返り値
( void )
なし
引数
( BOOL )flag
YES/NO
フレームワーク
Foundation
クラス
NSNumberFormatter
Instance Methods
使用可能
10.0
参照
- allowsFloats
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSNumberFormatter *numFormat = [[[NSNumberFormatter alloc] init] autorelease] ; [numFormat setHasThousandSeparators:YES]; [numFormat setAllowsFloats:NO]; [myOutlet setFormatter:numFormat]; if ([[myOutlet formatter] allowsFloats]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end