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

setNilValueForKey(_:)

Invoked by setValue(_:forKey:) when it’s given a nil value for a scalar value (such as an int or float).

Declaration 宣言

func setNilValueForKey(_ key: String)

Parameters パラメータ

key

The name of one of the receiver's properties.

Discussion 解説

Subclasses can override this method to handle the request in some other way, such as by substituting 0 or a sentinel value for nil and invoking setValue(_:forKey:) again or setting the variable directly. The default implementation raises an NSInvalidArgumentException.

See Also 参照

Setting Values 値を設定する