public T AllocInit <T>() where T : struct { IntPtr value = ObjectiveCRuntime.IntPtr_objc_msgSend(NativePtr, "alloc"); ObjectiveCRuntime.objc_msgSend(value, "init"); return(Unsafe.AsRef <T>(&value)); }
public IntPtr GetProperty(string propertyName) { int byteCount = Encoding.UTF8.GetMaxByteCount(propertyName.Length); byte *utf8BytesPtr = stackalloc byte[byteCount]; fixed(char *namePtr = propertyName) { Encoding.UTF8.GetBytes(namePtr, propertyName.Length, utf8BytesPtr, byteCount); } return(ObjectiveCRuntime.class_getProperty(this, utf8BytesPtr)); }
public ObjCClass(string name) { int byteCount = Encoding.UTF8.GetMaxByteCount(name.Length); byte *utf8BytesPtr = stackalloc byte[byteCount]; fixed(char *namePtr = name) { Encoding.UTF8.GetBytes(namePtr, name.Length, utf8BytesPtr, byteCount); } NativePtr = ObjectiveCRuntime.objc_getClass(utf8BytesPtr); }
public Selector(string name) { int byteCount = Encoding.UTF8.GetMaxByteCount(name.Length); byte *utf8BytesPtr = stackalloc byte[byteCount]; fixed(char *namePtr = name) { Encoding.UTF8.GetBytes(namePtr, name.Length, utf8BytesPtr, byteCount); } NativePtr = ObjectiveCRuntime.sel_registerName(utf8BytesPtr); }
public ObjectiveCMethod *class_copyMethodList(out uint count) { return(ObjectiveCRuntime.class_copyMethodList(this, out count)); }
public unsafe void setConstantValuetypeatIndex(void *value, MTLDataType type, UIntPtr index) { ObjectiveCRuntime.objc_msgSend(NativePtr, sel_setConstantValuetypeatIndex, value, (uint)type, index); }
public T Alloc <T>() where T : struct { IntPtr value = ObjectiveCRuntime.IntPtr_objc_msgSend(NativePtr, Selectors.alloc); return(Unsafe.AsRef <T>(&value)); }