macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

stringForObjectValue:

文字列を返します
-(NSString *)stringForObjectValue:(id)anObject:

解説

文字列を返します。
サブクラスでオーバーライドします。

返り値

( NSString * )

文字列

引数

( id )anObject

オブジェクト

クラス

NSFormatter

Instance Methods

使用可能

10.0

参照

- attributedStringForObjectValue:withDefaultAttributes:
- editingStringForObjectValue:
- getObjectValue:forString:errorDescription:

例文

//オブジェクト値 必須
- (NSString *)stringForObjectValue:(id)anObject
{
NSLog([NSString stringWithFormat:@"%.3f",[anObject floatValue]]);
    return [NSString stringWithFormat:@"$%.3f", [anObject floatValue]];
}