NSArray.FromNSObjects 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.
Overloads
| Name | Description |
|---|---|
| FromNSObjects(IntPtr, INativeObject[]) |
Creates an NSArray from a C# array of objects implementing INativeObject, using the first |
| FromNSObjects(Int32, INativeObject[]) |
Creates an NSArray from a C# array of objects implementing INativeObject, using the first |
| FromNSObjects(IntPtr, NSObject[]) |
Creates an NSArray from the first |
| FromNSObjects(INativeObject[]) |
Creates an NSArray from a C# array of objects implementing INativeObject. |
| FromNSObjects(Int32, NSObject[]) |
Creates an NSArray from the first |
| FromNSObjects(NSObject[]) |
Creates an NSArray from a C# array of NSObjects. |
| FromNSObjects<T>(T[,]) |
Creates a nested NSArray from a two-dimensional array of objects implementing INativeObject. |
| FromNSObjects<T>(T[]) |
Creates an NSArray from a C# array of objects implementing INativeObject. |
| FromNSObjects<T>(T[][]) |
Creates a nested NSArray from a jagged array of objects implementing INativeObject. |
| FromNSObjects<T>(Func<T,NSObject>, T[]) |
Creates an NSArray from a C# array using a custom conversion function. |
| FromNSObjects<T>(Int32, T[]) |
Creates an NSArray from a C# array of objects implementing INativeObject, using the first |
| FromNSObjects<T>(IntPtr, T[]) |
Creates an NSArray from a C# array of objects implementing INativeObject, using the first |
FromNSObjects(IntPtr, INativeObject[])
Creates an NSArray from a C# array of objects implementing INativeObject, using the first count elements.
public static Foundation.NSArray FromNSObjects(IntPtr count, params ObjCRuntime.INativeObject?[]? items);
static member FromNSObjects : nativeint * ObjCRuntime.INativeObject[] -> Foundation.NSArray
Parameters
- count
-
IntPtr
nativeint
Number of items to copy from the items array.
- items
- INativeObject[]
Array of objects implementing INativeObject. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects(Int32, INativeObject[])
Creates an NSArray from a C# array of objects implementing INativeObject, using the first count elements.
public static Foundation.NSArray FromNSObjects(int count, params ObjCRuntime.INativeObject[] items);
public static Foundation.NSArray FromNSObjects(int count, params ObjCRuntime.INativeObject?[]? items);
static member FromNSObjects : int * ObjCRuntime.INativeObject[] -> Foundation.NSArray
Parameters
- count
- Int32
Number of items to copy from the items array.
- items
- INativeObject[]
Array of objects implementing INativeObject. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects(IntPtr, NSObject[])
Creates an NSArray from the first count elements of a C# array of NSObjects.
public static Foundation.NSArray FromNSObjects(IntPtr count, params Foundation.NSObject?[]? items);
static member FromNSObjects : nativeint * Foundation.NSObject[] -> Foundation.NSArray
Parameters
- count
-
IntPtr
nativeint
Number of items to copy from the items array.
- items
- NSObject[]
Strongly typed array of NSObjects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects(INativeObject[])
Creates an NSArray from a C# array of objects implementing INativeObject.
public static Foundation.NSArray FromNSObjects(params ObjCRuntime.INativeObject[] items);
public static Foundation.NSArray FromNSObjects(params ObjCRuntime.INativeObject?[]? items);
static member FromNSObjects : ObjCRuntime.INativeObject[] -> Foundation.NSArray
Parameters
- items
- INativeObject[]
Array of objects implementing INativeObject. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the specified objects.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects(Int32, NSObject[])
Creates an NSArray from the first count elements of a C# array of NSObjects.
public static Foundation.NSArray FromNSObjects(int count, params Foundation.NSObject[] items);
public static Foundation.NSArray FromNSObjects(int count, params Foundation.NSObject?[]? items);
static member FromNSObjects : int * Foundation.NSObject[] -> Foundation.NSArray
Parameters
- count
- Int32
Number of items to copy from the items array.
- items
- NSObject[]
Strongly typed array of NSObjects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects(NSObject[])
Creates an NSArray from a C# array of NSObjects.
public static Foundation.NSArray FromNSObjects(params Foundation.NSObject[] items);
public static Foundation.NSArray FromNSObjects(params Foundation.NSObject?[]? items);
static member FromNSObjects : Foundation.NSObject[] -> Foundation.NSArray
Parameters
- items
- NSObject[]
Strongly typed array of NSObjects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the specified objects.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects<T>(T[,])
Creates a nested NSArray from a two-dimensional array of objects implementing INativeObject.
public static Foundation.NSArray FromNSObjects<T>(T[,] items) where T : class, ObjCRuntime.INativeObject;
public static Foundation.NSArray? FromNSObjects<T>(T[,]? items) where T : class, ObjCRuntime.INativeObject;
static member FromNSObjects : 'T[,] -> Foundation.NSArray (requires 'T : null and 'T :> ObjCRuntime.INativeObject)
Type Parameters
- T
The type of objects in the array, which must implement INativeObject.
Parameters
- items
- T[,]
A two-dimensional array of objects. If null, returns null.
Returns
A new NSArray containing nested NSArrays, one for each row of the 2D array. Returns null if items is null.
Remarks
The two-dimensional array is converted to a jagged array structure where each row becomes a nested NSArray.
Applies to
FromNSObjects<T>(T[])
Creates an NSArray from a C# array of objects implementing INativeObject.
public static Foundation.NSArray FromNSObjects<T>(params T[] items) where T : class, ObjCRuntime.INativeObject;
public static Foundation.NSArray FromNSObjects<T>(params T?[]? items) where T : class, ObjCRuntime.INativeObject;
static member FromNSObjects : 'T[] -> Foundation.NSArray (requires 'T : null and 'T :> ObjCRuntime.INativeObject)
Type Parameters
- T
The type of objects in the array, which must implement INativeObject.
Parameters
- items
- T[]
Array of objects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the specified objects.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects<T>(T[][])
Creates a nested NSArray from a jagged array of objects implementing INativeObject.
public static Foundation.NSArray FromNSObjects<T>(params T[][] items) where T : class, ObjCRuntime.INativeObject;
public static Foundation.NSArray? FromNSObjects<T>(params T[][]? items) where T : class, ObjCRuntime.INativeObject;
static member FromNSObjects : 'T[][] -> Foundation.NSArray (requires 'T : null and 'T :> ObjCRuntime.INativeObject)
Type Parameters
- T
The type of objects in the array, which must implement INativeObject.
Parameters
- items
- T[][]
A jagged array of objects. If null, returns null.
Returns
A new NSArray containing nested NSArrays for each row. Returns null if items is null.
Exceptions
Thrown if any row or element in the jagged array is null.
Remarks
Each row of the jagged array is converted to an NSArray, and these NSArrays are then stored in the returned NSArray. Individual row elements and rows themselves cannot be null.
Applies to
FromNSObjects<T>(Func<T,NSObject>, T[])
Creates an NSArray from a C# array using a custom conversion function.
public static Foundation.NSArray FromNSObjects<T>(Func<T,Foundation.NSObject> nsobjectificator, params T[] items);
public static Foundation.NSArray? FromNSObjects<T>(Func<T?,Foundation.NSObject?> nsobjectificator, params T?[]? items);
static member FromNSObjects : Func<'T, Foundation.NSObject> * 'T[] -> Foundation.NSArray
Type Parameters
- T
The type of objects in the input array.
Parameters
A function that converts each item in the array to an NSObject. The function may return null.
- items
- T[]
Array of objects to convert. If null, returns null.
Returns
A new NSArray containing the converted objects. Returns null if items is null.
Exceptions
Thrown if nsobjectificator is null.
Remarks
Each item is converted using the provided function. Null results from the conversion function are stored as Null in the resulting array.
Applies to
FromNSObjects<T>(Int32, T[])
Creates an NSArray from a C# array of objects implementing INativeObject, using the first count elements.
public static Foundation.NSArray FromNSObjects<T>(int count, params T[] items) where T : class, ObjCRuntime.INativeObject;
public static Foundation.NSArray FromNSObjects<T>(int count, params T?[]? items) where T : class, ObjCRuntime.INativeObject;
static member FromNSObjects : int * 'T[] -> Foundation.NSArray (requires 'T : null and 'T :> ObjCRuntime.INativeObject)
Type Parameters
- T
The type of objects in the array, which must implement INativeObject.
Parameters
- count
- Int32
Number of items to copy from the items array.
- items
- T[]
Array of objects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.
Applies to
FromNSObjects<T>(IntPtr, T[])
Creates an NSArray from a C# array of objects implementing INativeObject, using the first count elements.
public static Foundation.NSArray FromNSObjects<T>(IntPtr count, params T?[]? items) where T : class, ObjCRuntime.INativeObject;
static member FromNSObjects : nativeint * 'T[] -> Foundation.NSArray (requires 'T : null and 'T :> ObjCRuntime.INativeObject)
Type Parameters
- T
The type of objects in the array, which must implement INativeObject.
Parameters
- count
-
IntPtr
nativeint
Number of items to copy from the items array.
- items
- T[]
Array of objects. Null elements are stored as Null. If the array itself is null, an empty NSArray is returned.
Returns
A new NSArray containing the first count objects from the array.
Remarks
Null items in the array are converted to Null instances.