Class NSArray<T>
- Namespace
- CarinaStudio.MacOS.ObjectiveC
- Assembly
- CarinaStudio.AppBase.MacOS.dll
NSArray.
public class NSArray<T> : NSObject, IDisposable, IEquatable<NSObject>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : NSObject
Type Parameters
T
- Inheritance
-
NSArray<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
NSArray(IEnumerable<T>)
Initialize new NSArray<T> instance.
public NSArray(IEnumerable<T> objects)
Parameters
objectsIEnumerable<T>Elements.
NSArray(params T[])
Initialize new NSArray<T> instance.
public NSArray(params T[] objects)
Parameters
objectsT[]Elements.
Properties
Count
Get number of element in array.
public int Count { get; }
Property Value
this[int]
Get element at given position.
public T this[int index] { get; }
Parameters
indexint
Property Value
- T
Methods
Contains(T?)
Check whether given object is contained in array or not.
public bool Contains(T? obj)
Parameters
objTObject to check.
Returns
- bool
True if given object is contained in array.
CopyTo(T[], int)
Copy elements from array.
public void CopyTo(T[] array, int arrayIndex)
Parameters
arrayT[]Array.
arrayIndexintIndex of first position in
arrayto put copied elements.
GetEnumerator()
Get enumerator.
public IEnumerator<T> GetEnumerator()
Returns
- IEnumerator<T>
Enumerator.
IndexOf(T)
Get position of given object in array.
public int IndexOf(T obj)
Parameters
objTObject to check.
Returns
- int
Index of position of object.
Initialize(IntPtr, NSArray<T>)
Initialize allocated instance with array.
protected static IntPtr Initialize(IntPtr obj, NSArray<T> array)
Parameters
Returns
- nint
Handle of initialized instance.
Initialize(IntPtr, IEnumerable<T>)
Initialize allocated instance with initial objects.
protected static IntPtr Initialize(IntPtr obj, IEnumerable<T> objects)
Parameters
objnintHandle of allocated instance.
objectsIEnumerable<T>Objects.
Returns
- nint
Handle of initialized instance.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.