public UIActivityViewController(string text, UIImage image) { IntPtr textHandle = ObjC.ToNSString(text); IntPtr array = ObjC.ToNSArray(new[] { textHandle, image.Handle }); ObjC.MessageSendIntPtr(Handle, "initWithActivityItems:applicationActivities:", array, IntPtr.Zero); ObjC.MessageSend(textHandle, "release"); }
public NSObject[] ObjectsForKeys(string[] keys) { var keysHandle = ObjC.ToNSArray(keys); var arrayPtr = Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, "objectsForKeys:notFoundMarker:", keysHandle, new NSObject().Handle)); var array = ObjC.FromNSArray <NSObject>(arrayPtr.Handle); ObjC.ReleaseNSArrayItems(keysHandle); return(array); }
public static NSDictionary FromObjectsAndKeys(NSObject[] objs, string[] keys) { var objectsHandle = ObjC.ToNSArray(objs); var keysHandle = ObjC.ToNSArray(keys); var dictionary = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, "dictionaryWithObjects:forKeys:", objectsHandle, keysHandle)); ObjC.ReleaseNSArrayItems(keysHandle); return(dictionary); }
public UIActivityViewController(UIImage image) { IntPtr array = ObjC.ToNSArray(new[] { image.Handle }); ObjC.MessageSendIntPtr(Handle, "initWithActivityItems:applicationActivities:", array, IntPtr.Zero); }