In objectiveC given an NSArray fred containing strings I can say:
NSString *s = [fred ObjectAtIndex:5];
What is the c# equivalent? Rosetta stone says to use the method ValueAt
but that returns an IntPtr
.
var i = fred.ValueAt(5);
But then you are left with how to convert an IntPtr
to NSString
pointer.
Going via IntPtr feels like a bad idea. Instead, as long as you know the type of the item you want to get, you can just use the following:
int index = 0;
NSString str = myNsArr.GetItem<NSString>(index);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With