Mac Guides | Samples

MonoMac.Foundation.NSSet Class

An unordered collection of distinct items.

See Also: NSSet


[MonoMac.Foundation.Register("NSSet", true)]
public class NSSet : NSObject, IEnumerable<NSObject>


The following example shows how to create a set

c# Example

// Create the set out of four objects
var myColors = new NSSet (UIColor.Red, UIColor.Blue, UIColor.Yellow, UIColor.Red);

// The resulting array will only contain Red, Blue and Yellow
UIColor [] asArray = myColors.ToArray<UIColor> ();


Namespace: MonoMac.Foundation
Assembly: XamMac (in XamMac.dll)
Assembly Versions:

The members of MonoMac.Foundation.NSSet are listed below.

See Also: NSObject

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
Creates a set from an NSArray of objects.
A constructor that initializes the object from the data stored in the unarchiver object.
NSSet(params NSObject[])
Constructor to call on derived classes when the derived class has an [Export] constructor.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.
NSSet(params Object[])
NSSet(params String[])
Creates a set from an array of strings.

Public Properties

ClassHandleIntPtr. The handle for this class.

Public Methods

Contains(NSObject) : Boolean
Contains(Object) : Boolean
CreateSet() : NSSet
GetEnumerator() : IEnumerator<NSObject>
Enumerate over the NSObjects in the set.
IntersectsSet(NSSet) : Boolean
IsEqualToSet(NSSet) : Boolean
IsSubsetOf(NSSet) : Boolean
MakeNSObjectSet<T>(T[]) : NSSet
ToArray<T>() : T[]
Returns the contents of the set as a strongly typed array.

Protected Methods

Releases the resourced used by the NSSet object.

Public Operators

Explicitly Implemented Interface Members

NSSet$IEnumerable.GetEnumeratorEnumerate over the NSObjects in the set.