NSArray.FromObjects Method

Definition

Overloads

Name Description
FromObjects(Object[])

Creates an NSArray from a C# array of objects.

FromObjects(IntPtr, Object[])

Creates an NSArray from the first count elements of a C# array.

FromObjects(Object[])

Creates an NSArray from a C# array of objects.

public static Foundation.NSArray FromObjects(params object[] items);
public static Foundation.NSArray FromObjects(params object?[]? items);
static member FromObjects : obj[] -> Foundation.NSArray

Parameters

items
Object[]

Array of C# objects. Null elements will be boxed as Null. If the array itself is null, an empty NSArray is returned.

Returns

A new NSArray containing the boxed objects.

Remarks

The values will be boxed into NSObjects using FromObject(Object). Null items in the array are converted to Null instances.

Applies to

FromObjects(IntPtr, Object[])

Creates an NSArray from the first count elements of a C# array.

public static Foundation.NSArray FromObjects(IntPtr count, params object[] items);
public static Foundation.NSArray FromObjects(IntPtr count, params object?[]? items);
static member FromObjects : nativeint * obj[] -> Foundation.NSArray

Parameters

count
IntPtr

nativeint

Number of items to copy from the items array.

items
Object[]

Array of C# objects. Null elements will be boxed as Null. If the array itself is null, an empty NSArray is returned.

Returns

A new NSArray containing the first count boxed objects from the array.

Remarks

The values will be boxed into NSObjects using FromObject(Object). Null items in the array are converted to Null instances.

Applies to