public object[] ToArray()
{
ArrayList list = new ArrayList ();
Type t = null;
for (int i = 0; i < (int)ObjCMessaging.objc_msgSend (NativeObject, "count", typeof (int)); i++) {
list.Add (Object.FromIntPtr ((IntPtr) ObjCMessaging.objc_msgSend (NativeObject, "objectAtIndex:", typeof (IntPtr), typeof (int), i)));
if (t == null)
t = list [0].GetType ();
}
return (object [])list.ToArray (t);
}