Läs på engelska Redigera

Dela via


NSSet.ToArray<T> Method

Definition

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

C#
public T[] ToArray<T>() where T : class, 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

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

Applies to

Produkt Versioner
Xamarin iOS SDK 12