public void Setup() { // Create a new array nativeArray = MessageSend.IntPtr_objc_msgSend(MessageSend.IntPtr_objc_msgSend(mutablearray_class, Selector.GetHandle("alloc")), Selector.GetHandle("init")); for (var i = 0; i < ArraySize; i++) { var element = MessageSend.IntPtr_objc_msgSend(MessageSend.IntPtr_objc_msgSend(nsobject_class, Selector.GetHandle("alloc")), Selector.GetHandle("init")); MessageSend.void_objc_msgSend_IntPtr(nativeArray, Selector.GetHandle("addObject:"), element); MessageSend.void_objc_msgSend(element, Selector.GetHandle("release")); } MessageSend.void_objc_msgSend_IntPtr(obj.Handle, Selector.GetHandle("setSomeArray:"), nativeArray); }
public void CallExportedStaticMethod() { MessageSend.void_objc_msgSend(subclassed_class, Selector.GetHandle("exportedStaticMethod")); }
public void CallExportedInstanceMethod() { MessageSend.void_objc_msgSend(subclassed.Handle, Selector.GetHandle("exportedInstanceMethod")); }
public void CallOverriddenInstanceMethod() { MessageSend.void_objc_msgSend(subclassed.Handle, Selector.GetHandle("V")); }
public void Cleanup() { // cleanup after us MessageSend.void_objc_msgSend(nativeArray, Selector.GetHandle("release")); nativeArray = IntPtr.Zero; }
public void CallReturnUnknownManagedWrapperCleanup() { // cleanup after us MessageSend.void_objc_msgSend(someObjectUnknownManagedWrapper, Selector.GetHandle("release")); someObjectUnknownManagedWrapper = IntPtr.Zero; }