public abstract class ObjCObject extends NativeObject
| Modifier and Type | Class and Description |
|---|---|
static class |
ObjCObject.Marshaler |
static class |
ObjCObject.ObjCObjectPtr |
static class |
ObjCObject.Super |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
customClass |
| Modifier | Constructor and Description |
|---|---|
protected |
ObjCObject() |
protected |
ObjCObject(long handle) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
addStrongRef(T to) |
protected void |
afterMarshaled(int flags) |
protected long |
alloc() |
void |
dispose() |
protected void |
dispose(boolean finalizing) |
protected void |
doDispose() |
protected void |
finalize() |
Object |
getAssociatedObject(Object key) |
ObjCClass |
getObjCClass() |
protected ObjCSuper |
getSuper() |
protected void |
initObject(long handle) |
static void |
logRetainRelease(boolean enabled)
Sets whether retain/release of custom
ObjCObject should be logged
to the console to identify retain/release leaks. |
void |
removeStrongRef(Object to) |
void |
setAssociatedObject(Object key,
Object value) |
static <T extends ObjCObject> |
toObjCObject(Class<T> cls,
long handle,
int afterMarshaledFlags) |
static <T extends ObjCObject> |
toObjCObject(Class<T> cls,
long handle,
int afterMarshaledFlags,
boolean forceType) |
void |
updateStrongRef(Object before,
Object after)
Updates a strong reference handling
null values properly. |
protected void initObject(long handle)
protected long alloc()
protected final void finalize()
throws Throwable
public final void dispose()
protected void doDispose()
protected void dispose(boolean finalizing)
protected ObjCSuper getSuper()
protected void afterMarshaled(int flags)
public final ObjCClass getObjCClass()
public <T> T addStrongRef(T to)
public void removeStrongRef(Object to)
public void updateStrongRef(Object before, Object after)
null values properly. This is
meant to be used for Property setter methods with
strongRef=true.before - the previous value for the property. If not null
and not equal to after
removeStrongRef(Object) will be called on this value.after - the new value for the property. If not null and not
equal to after addStrongRef(Object) will be
called on this value.public static <T extends ObjCObject> T toObjCObject(Class<T> cls, long handle, int afterMarshaledFlags)
public static <T extends ObjCObject> T toObjCObject(Class<T> cls, long handle, int afterMarshaledFlags, boolean forceType)
public static void logRetainRelease(boolean enabled)
ObjCObject should be logged
to the console to identify retain/release leaks. Note that the GC has to
be able to collect the custom object for the final release to be
triggered.
The output logs the class, memory address and retain count after the
release/retain invocation. You can use the memory address to inspect
custom objects in Instruments.Copyright © 2012-2015 RoboVM AB. All Rights Reserved.