예제 #1
0
 public static NSDictionary FromFile(string path)
 {
     return(Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dictionaryWithContentsOfFile:"), path)));
 }
예제 #2
0
 public string[] KeysForObject(NSObject obj)
 {
     return(ObjC.FromNSArray(Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("allKeysForObject:"), obj.Handle)).Handle));
 }
예제 #3
0
        public NSObject[] ObjectsForKeys(string[] keys)
        {
            IntPtr intPtr = ObjC.ToNSArray(keys);

            NSObject[] result = ObjC.FromNSArray <NSObject>(Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, Selector.GetHandle("objectsForKeys:notFoundMarker:"), intPtr, new NSObject().Handle)).Handle);
            ObjC.ReleaseNSArrayItems(intPtr);
            return(result);
        }
예제 #4
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);
        }
예제 #5
0
        public static NSDictionary FromObjectsAndKeys(NSObject[] objs, string[] keys)
        {
            IntPtr       arg      = ObjC.ToNSArray(objs);
            IntPtr       intPtr   = ObjC.ToNSArray(keys);
            NSDictionary nSObject = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dictionaryWithObjects:forKeys:"), arg, intPtr));

            ObjC.ReleaseNSArrayItems(intPtr);
            return(nSObject);
        }
예제 #6
0
        public static NSDictionary FromObjectAndKey(NSObject obj, string key)
        {
            IntPtr       intPtr   = ObjC.ToNSString(key);
            NSDictionary nSObject = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dictionaryWithObject:forKey:"), obj.Handle, intPtr));

            ObjC.MessageSend(intPtr, Selector.ReleaseHandle);
            return(nSObject);
        }