NSArray.FromArray<T>(NSArray) Method

Definition

Returns a strongly-typed C# array of the parametrized type from a weakly typed NSArray.

public static T[] FromArray<T> (Foundation.NSArray weakArray) where T : Foundation.NSObject;
static member FromArray : Foundation.NSArray -> 'T[] (requires 'T :> Foundation.NSObject)

Type Parameters

T

Parameter type, determines the kind of array returned, limited to NSObject and subclasses of it.

Parameters

weakArray
NSArray

Handle to an weakly typed NSArray.

Returns

T[]

An C# array with the values.

Remarks

Use this method to get a set of NSObject arrays from an NSArray.

NSArray someArray = ...;

NSString [] values = NSArray.FromArray<CGImage> (someArray);

Applies to