NSArray.GetItem<T>(UIntPtr) Method

Definition

Returns the element at the specified index in the NSArray, as a strongly-typed object.

public T GetItem<T>(UIntPtr index) where T : class, ObjCRuntime.INativeObject;
public T? GetItem<T>(UIntPtr index) where T : class, ObjCRuntime.INativeObject;
member this.GetItem : unativeint -> 'T (requires 'T : null and 'T :> ObjCRuntime.INativeObject)

Type Parameters

T

The type to return the element as. Must be a class that implements INativeObject.

Parameters

index
UIntPtr

unativeint

The zero-based index of the element to retrieve.

Returns

T

The element at index, or null if the element cannot be converted to T.

Exceptions

index is greater than or equal to the array's count.

Applies to