static AccessoryInfo[] ExtractAccessoryInfo (IntPtr ptr, NSString id, NSString description)
		{
			using (var array = new CFArray (ptr)) {
				var res = new AccessoryInfo [array.Count];
				for (int i = 0; i < res.Length; ++i) {
					var dict = array.GetValue (i);
					var n = new NSNumber (CFDictionary.GetValue (dict, id.Handle));
					var desc = CFString.FetchString (CFDictionary.GetValue (dict, description.Handle));

					res [i] = new AccessoryInfo ((int) n, desc);
					id.Dispose ();
				}
				return res;
			}
		}
Exemple #2
0
        static AccessoryInfo[] ExtractAccessoryInfo(IntPtr ptr, NSString id, NSString description)
        {
            using (var array = new CFArray (ptr)) {
                var res = new AccessoryInfo [array.Count];
                for (int i = 0; i < res.Length; ++i) {
                    var dict = array.GetValue (i);
                    var n = new NSNumber (CFDictionary.GetValue (dict, id.Handle));
                    var desc = CFString.FetchString (CFDictionary.GetValue (dict, description.Handle));

                    res [i] = new AccessoryInfo ((int) n, desc);
                    id.Dispose ();
                }
                return res;
            }
        }