Function 関数

objc_loadWeak(_:)

Loads the object referenced by a weak pointer and returns it. 弱いポインタによって参照されたオブジェクトをロードします、そしてそれを返します。

Declaration 宣言

func objc_loadWeak(_ location: AutoreleasingUnsafeMutablePointer<AnyObject?>) -> Any?

Parameters パラメータ

location

The address of the weak pointer.

Return Value 戻り値

The object pointed to by location, or nil if location is nil.

Discussion 解説

This function loads the object referenced by a weak pointer and returns it after retaining and autoreleasing the object. As a result, the object stays alive long enough for the caller to use it. This function is typically used anywhere a __weak variable is used in an expression.

See Also 参照

Using Objective-C Language Features Objective-C言語機能を使う