Function 関数

objc_storeWeak(_:_:)

Stores a new value in a __weak variable.

Declaration 宣言

func objc_storeWeak(_ location: AutoreleasingUnsafeMutablePointer<AnyObject?>, 
                  _ obj: Any?) -> Any?

Parameters パラメータ

location

The address of the weak pointer.

obj

The new object you want the weak pointer to now point to.

Return Value 戻り値

The value stored in location (that is, obj).

Discussion 解説

This function is typically used anywhere a __weak variable is the target of an assignment.

See Also 参照

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