descriptionWithLocale:
ローカライズ辞書を使って内容を文字列で返します
-(NSString *)descriptionWithLocale:(id)locale
解説
ローカライズ辞書を使って内容を文字列で返します。
返り値
( NSString * )
文字列
引数
( id )locale
NSDictionaryまたはNSLocate
辞書のキーや値をそれぞれフォーマットする指定のオプション
フォーマットが必要なければnilを渡します。
iOSやOS X 10.5以降ではNSDictionaryやNSLocaleオブジェクトのインスタンスを使う。
OS X 10.4ではNSDictionaryのインスタンスを使う。
それぞれのキーはcompare:に対応するなら、エントリーはキーで昇順に並べられる。
そうでなければ未定義
フレームワーク
Foundation
クラス
NSDictionary
Instance Methods
使用可能
OS X 10.0以降
iOS 2.0以降
参照
- description
- descriptionWithLocale:indent:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDictionary *dic= [[NSDictionary alloc] initWithObjectsAndKeys: @",",@"NSDecimalSeparator",//小数点区切りフランスでは,が小数点 nil]; NSDictionary *dic2 = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat:233.333],@"sun", [NSNumber numberWithFloat:124.34],@"mon", [NSNumber numberWithFloat:1234.23],@"sat",nil]; NSLog([dic2 descriptionWithLocale:dic]); } @end