ObjCObject

public class ObjCObject extends NativeObject

The Ascendant of every Objective-C native object.

Inherit from this class or NSObject to define a binding, inherited or a hybrid class. Binding classes are used to bind native classes without doing any modifications against them. Inherited classes are created by JVM, and every implementation in them is implemented in Java. Hybrid classes are created in Objective-C runtime side but they can have Java implementations injected into them.

Binding mode will be in use if the class is marked with the ObjCClassBinding annotation Hybrid mode will be in use if we are defining a class with a name that is already taken by an existing native Objective-C class. Otherwise, inherited mode will be used.

Note: Hidden implementations in Objective-C class of hybrid classes is not supported and they won’t be invoked by NatJ at all.

Constructors

ObjCObject

protected ObjCObject(Pointer peer)

Construct an Objective-C object from a pointer.

Parameters:
  • peer – Objective-C object pointer

Methods

equals

public boolean equals(Object obj)

isEqual

public boolean isEqual(Object obj)

Objective-C’s isEqual method.

Parameters:
  • obj – object to compare with
Returns:

true if equals, otherwise false

toString

public String toString()

Returns the Objective-C object description.

Returns:Object description