편집

다음을 통해 공유


NSSet.ToArray<T> Method

Definition

Returns the contents of the set as a strongly typed array.

public T[] ToArray<T> () where T : class, ObjCRuntime.INativeObject;
member this.ToArray : unit -> 'T[] (requires 'T : null and 'T :> ObjCRuntime.INativeObject)

Type Parameters

T

Strongly typed version of the array that you want to get, must be a class that derives from NSObject.

Returns

T[]

An array of type T with the contents of the set.

Remarks

The following example shows how to get an array of UIFonts

var myColors = new NSSet (UIColor.Red, UIColor.Blue, UIColor.Yellow);
UIColor [] asArray = myColors.ToArray<UIColor> ();

Applies to