Stores a new value in a _
variable.
SDKs
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Objective-C Runtime
Declaration
func objc_storeWeak(_ location: Autoreleasing Unsafe Mutable Pointer<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 _
variable is the target of an assignment.