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 CallReturnUnknownManagedWrapperSetup() { // Create a new object that the bridge knows about someObjectUnknownManagedWrapper = MessageSend.IntPtr_objc_msgSend(MessageSend.IntPtr_objc_msgSend(nsobject_class, Selector.GetHandle("alloc")), Selector.GetHandle("init")); MessageSend.void_objc_msgSend_IntPtr(obj.Handle, Selector.GetHandle("setSomeObject:"), someObjectUnknownManagedWrapper); }
public void CallReturnKnownManagedWrapperSetup() { // Create a new object that the bridge knows about someObjectKnownManagedWrapper = new NSObject(); MessageSend.void_objc_msgSend_IntPtr(obj.Handle, Selector.GetHandle("setSomeObject:"), someObjectKnownManagedWrapper.Handle); }