示例#1
0
        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");
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        public UIActivityViewController(UIImage image)
        {
            IntPtr array = ObjC.ToNSArray(new[] { image.Handle });

            ObjC.MessageSendIntPtr(Handle, "initWithActivityItems:applicationActivities:", array, IntPtr.Zero);
        }