Instance Method インスタンスメソッド

floatForKey:

Returns the float value associated with the specified key. 指定されたキーと結びつけられたfloat値を返します。

Declaration 宣言

- (float)floatForKey:(NSString *)defaultName;

Parameters パラメータ

defaultName

A key in the current user‘s defaults database. 現在のユーザのもつdefaultsデータベースの中のあるキー。

Return Value 戻り値

The float value associated with the specified key. If the key doesn‘t exist, this method returns 0. 指定されたキーと結びつけられたfloat値。キーが存在しないならば、このメソッドは0を返します。

Discussion 議論

This method automatically coerces certain values into equivalent float values (if one can be determined). The Boolean value YES becomes 1.0 and NO becomes 0.0. An integer becomes the equivalent float (for example, 2 becomes 2.0). A string that represents a floating point number becomes the equivalent float (for example “123.4“ becomes 123.4). このメソッドは、自動的に特定の値を同等のfloat値へと強制します(もしそれが決定されることが可能ならば)。ブール値YESは、1.0になります、そしてNO0.0になります。ある整数は、同等のfloatになります(例えば、22.0になります)。浮動小数点数を表している文字列は、同等のfloatになります(例えば “123.4“ は、123.4になります)。

See Also 参照

Getting Default Values defaults値を取得する

Related Documentation 関連文書