fun detachObjCObject(obj: ObjCObject)

Detaches the Objective-C object from this Kotlin wrapper. More specifically, releases the Obj-C reference and zeroes the field where it is stored.

This doesn't affect other possible Kotlin wrappers of this Objective-C object. Typically, when an Objective-C object gets into Kotlin, a new Kotlin wrapper is created, even if there is another wrapper already exists. To get the Objective-C object actually deallocated, each Kotlin wrapper should first be either GCed or detached with this function.

If you use this object (Kotlin wrapper) after calling this function, the program behavior is undefined. In particular, it can crash.