示例#1
0
        public void RemoveObjectForKey(string key)
        {
            IntPtr intPtr = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("removeObjectForKey:"), intPtr);
            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
        }
示例#2
0
        public void SetObjectForKey(NSObject obj, string key)
        {
            IntPtr intPtr = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("setObject:forKey:"), obj.Handle, intPtr);
            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
        }
示例#3
0
        public UIActivityViewController(string text, UIImage image)
        {
            IntPtr textHandle = ObjC.ToNSString(text);
            IntPtr array      = ObjC.ToNSArray(new[] { textHandle, image.Handle });

            ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("initWithActivityItems:applicationActivities:"), array, IntPtr.Zero);
            ObjC.MessageSend(textHandle, Selector.ReleaseHandle);
        }
示例#4
0
        public NSObject ObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);
            var    value  = Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("objectForKey:"), handle));

            ObjC.MessageSend(handle, Selector.ReleaseHandle);
            return(value);
        }
示例#5
0
        public static NSDictionary FromObjectAndKey(NSObject obj, string key)
        {
            IntPtr handle     = ObjC.ToNSString(key);
            var    dictionary = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dictionaryWithObject:forKey:"), obj.Handle, handle));

            ObjC.MessageSend(handle, Selector.ReleaseHandle);
            return(dictionary);
        }
示例#6
0
        public new static NSMutableDictionary FromObjectAndKey(NSObject obj, string key)
        {
            IntPtr intPtr = ObjC.ToNSString(key);
            NSMutableDictionary nSObject = Runtime.GetNSObject <NSMutableDictionary>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dictionaryWithObject:forKey:"), obj.Handle, intPtr));

            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
            return(nSObject);
        }
示例#7
0
        public NSObject ObjectForKey(string key)
        {
            IntPtr   intPtr   = ObjC.ToNSString(key);
            NSObject nSObject = Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("objectForKey:"), intPtr));

            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
            return(nSObject);
        }
示例#8
0
        public UIActivityViewController(string text)
        {
            IntPtr intPtr = ObjC.ToNSString(text);
            IntPtr arg    = ObjC.ToNSArray(new IntPtr[1]
            {
                intPtr
            });

            ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("initWithActivityItems:applicationActivities:"), arg, IntPtr.Zero);
            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
        }
示例#9
0
 private bool ObjectForKeyBool(string key)
 {
     return(ObjC.MessageSendBool(Handle, Selector.GetHandle("objectForKey:"), ObjC.ToNSString(key)));
 }
示例#10
0
 private string ObjectForKey(string key)
 {
     return(ObjC.FromNSString(ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("objectForKey:"), ObjC.ToNSString(key))));
 }