Function

objc_removeAssociatedObjects

Removes all associations for a given object.

Declaration

void objc_removeAssociatedObjects(id object);

Parameters

object

An object that maintains associated objects.

Discussion

The main purpose of this function is to make it easy to return an object to a "pristine state”. You should not use this function for general removal of associations from objects, since it also removes associations that other clients may have added to the object. Typically you should use objc_setAssociatedObject with a nil value to clear an association.

See Also

Associative References

objc_setAssociatedObject

Sets an associated value for a given object using a given key and association policy.

objc_getAssociatedObject

Returns the value associated with a given object for a given key.