コード例 #1
0
        public void RemoveObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, "removeObjectForKey:", handle);
            ObjC.MessageSend(handle, "release");
        }
コード例 #2
0
        public void SetObjectForKey(NSObject obj, string key)
        {
            IntPtr handle = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, "setObject:forKey:", obj.Handle, handle);
            ObjC.MessageSend(handle, "release");
        }
コード例 #3
0
ファイル: NSDictionary.cs プロジェクト: gdseller/iOS4Unity
        public NSObject ObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);
            var    value  = Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, "objectForKey:", handle));

            ObjC.MessageSend(handle, "release");
            return(value);
        }
コード例 #4
0
ファイル: NSDictionary.cs プロジェクト: gdseller/iOS4Unity
        public static NSDictionary FromObjectAndKey(NSObject obj, string key)
        {
            IntPtr handle     = ObjC.ToNSString(key);
            var    dictionary = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, "dictionaryWithObject:forKey:", obj.Handle, handle));

            ObjC.MessageSend(handle, "release");
            return(dictionary);
        }
コード例 #5
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");
        }