NSArray.FromArray<T>(NSArray) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a strongly-typed C# array from a weakly typed NSArray.
public static T[] FromArray<T>(Foundation.NSArray weakArray) where T : Foundation.NSObject;
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
The element type for the returned array, limited to NSObject and subclasses.
Parameters
Returns
A C# array of T elements, or null if
weakArray is null or a conversion error occurs.
Elements that are NSNull or not compatible with T are excluded.
Remarks
NSArray someArray = ...;
var values = NSArray.FromArray<NSString> (someArray);