public static ObjCClass getFromObject(ObjCObject id) { long handle = id.getHandle(); ObjCClass c = null; if (handle != 0L) { long classPtr = ObjCRuntime.object_getClass(handle); c = ObjCObject.getPeerObject(classPtr); } if (c != null) { return c; } return getByType(id.getClass()); }
T o = getPeerObject(handle); if (o != null && o.getHandle() != 0) { if (!expectedType.isAssignableFrom(o.getClass())) {
public static ObjCClass toObjCClass(final long handle) { long classPtr = handle; ObjCClass c = ObjCObject.getPeerObject(classPtr); if (c == null) { c = getByNameNotLoaded(VM.newStringUTF(ObjCRuntime.class_getName(classPtr))); c = ObjCObject.getPeerObject(classPtr); if (c == null) { c = getByNameNotLoaded(VM.newStringUTF(ObjCRuntime.class_getName(classPtr)));
/** * instead of tracking object in retain callback following direct api is used. * as with retain there are known issues that retain could be called inside dealoc cycle * which will cause hard to handle side effects * @param self pointer from native part */ public static void retainObject(long self) { synchronized (CUSTOM_OBJECTS) { ObjCObject obj = ObjCObject.getPeerObject(self); CUSTOM_OBJECTS.put(self, obj); } }
public static ObjCClass getFromObject(ObjCObject id) { long handle = id.getHandle(); ObjCClass c = null; if (handle != 0L) { long classPtr = ObjCRuntime.object_getClass(handle); c = ObjCObject.getPeerObject(classPtr); } if (c != null) { return c; } return getByType(id.getClass()); }
T o = getPeerObject(handle); if (o != null && o.getHandle() != 0) { if (!expectedType.isAssignableFrom(o.getClass())) {
public static ObjCClass toObjCClass(final long handle) { long classPtr = handle; ObjCClass c = ObjCObject.getPeerObject(classPtr); if (c == null) { c = getByNameNotLoaded(VM.newStringUTF(ObjCRuntime.class_getName(classPtr))); c = ObjCObject.getPeerObject(classPtr); if (c == null) { c = getByNameNotLoaded(VM.newStringUTF(ObjCRuntime.class_getName(classPtr)));