Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 5
0
 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));
        }