WeakReference

public class WeakReference

Objective-C weak reference holder, used for weak pointers.

Constructors

WeakReference

public WeakReference(long object)

Creates an weak reference to an Objective-C object.

Parameters:
  • object – The object object to which we want to make the weak reference

Methods

finalize

protected void finalize()

Cleans up after the weak reference.

getNativePeer

public long getNativePeer()

Tries to load a strong reference to the Objective-C object.

It does no releasing, so you have to do it manually.

Returns:Weak referenced object pointer

getPeer

public Pointer getPeer()

Tries to load a strong reference to the Objective-C object.

Returns:Strong referenced object pointer loaded by Objective-C runtime