public void FromNSString() { string text = "WOOT"; IntPtr handle = ObjC.ToNSString(text); string actual = ObjC.FromNSString(handle); Assert.AreEqual(text, actual); }
public IntPtr MarshalManagedToNative(object managedObj) { string text = managedObj as string; if (text == null) { return(IntPtr.Zero); } return(ObjC.ToNSString(text)); }
public void FromNSArray() { string text = "woot"; IntPtr handle = ObjC.ToNSString(text); var arrayHandle = ObjC.ToNSArray(new[] { handle }); var array = ObjC.FromNSArray(arrayHandle); Assert.AreEqual(1, array.Length); Assert.AreEqual(text, array[0]); }