編集

次の方法で共有


NSArray.ArrayFromHandleFunc<T>(IntPtr, Func<IntPtr,T>) Method

Definition

Returns a strongly-typed C# array of the parametrized type from a handle to an NSArray.

public static T[] ArrayFromHandleFunc<T> (IntPtr handle, Func<IntPtr,T> createObject);
static member ArrayFromHandleFunc : nativeint * Func<nativeint, 'T> -> 'T[]

Type Parameters

T

Parameter type, determines the kind of array returned.

Parameters

handle
IntPtr

nativeint

Pointer (handle) to the unmanaged object.

createObject

Func<IntPtr,T>

Func<nativeint,T>

Returns

T[]

An C# array with the values.

Remarks

Use this method to get a set of NSObject arrays from a handle to an NSArray. Instead of wrapping the results in NSObjects, the code invokes your method to create the return value.

int [] args = NSArray.ArrayFromHandle<int> (someHandle, (x) => (int) x);

Applies to