In general, using NSArray is not very useful, because you ended up with the problems described above.
This is why, in general, you should convert NSArray to a strongly typed array. MonoMac's low-level runtime does this for all callbacks already on your behalf.
Usually you do this:
YourType [] stronglyTyped = NSArray.ArrayFromHandle<YourType> (arrayIntPtrHandle);
Note that NSArray can only store NSObjects, so "YourType" must be an object derived from NSObject.
, NSArray, , ValueAt (IntPtr), #, NSObject. Runtime.GetNSObject, :
YourType x = (YourType) Runtime.GetNSObject (NSArray.ValueAt (0));
API API Objective-C, . API , NSArray , :
[Export ("getElements")]
NSArray GetElements ();
:
[Export ("getElements")]
YourType [] GetElements ();