static public T [] FromArrayNative <T> (NSArray weakArray) where T : class, INativeObject { if (weakArray is null || weakArray.Handle == NativeHandle.Zero) { return(null); } try { nuint n = weakArray.Count; T [] ret = new T [n]; for (nuint i = 0; i < n; i++) { ret [i] = Runtime.GetINativeObject <T> (weakArray.ValueAt(i), false); } return(ret); } catch { return(null); } }
static public T [] FromArray <T> (NSArray weakArray) where T : NSObject { if (weakArray == null || weakArray.Handle == IntPtr.Zero) { return(null); } try { nuint n = weakArray.Count; T [] ret = new T [n]; for (nuint i = 0; i < n; i++) { ret [i] = Runtime.GetNSObject <T> (weakArray.ValueAt(i)); } return(ret); } catch { return(null); } }