pub struct Array<T = Object> { /* private fields */ }Expand description
An Objective-C array object.
C++ equivalent: NS::Array
Implementations§
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn array_with_object(object: *const T) -> Option<Self>
pub fn array_with_object(object: *const T) -> Option<Self>
Create an array with a single object.
C++ equivalent: static Array* array(const Object* pObject)
Sourcepub fn array_with_objects(
objects: *const *const T,
count: UInteger,
) -> Option<Self>
pub fn array_with_objects( objects: *const *const T, count: UInteger, ) -> Option<Self>
Create an array with multiple objects.
C++ equivalent: static Array* array(const Object* const* pObjects, UInteger count)
Sourcepub fn init(&self) -> Option<Self>
pub fn init(&self) -> Option<Self>
Initialize an allocated array.
C++ equivalent: Array* init()
Sourcepub fn init_with_objects(
&self,
objects: *const *const T,
count: UInteger,
) -> Option<Self>
pub fn init_with_objects( &self, objects: *const *const T, count: UInteger, ) -> Option<Self>
Initialize with multiple objects.
C++ equivalent: Array* init(const Object* const* pObjects, UInteger count)
Sourcepub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
pub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
Initialize with a coder.
C++ equivalent: Array* init(const class Coder* pCoder)
Sourcepub fn object(&self, index: UInteger) -> *mut T
pub fn object(&self, index: UInteger) -> *mut T
Get the object at the specified index.
C++ equivalent: template <class _Object = Object> _Object* object(UInteger index) const
Sourcepub fn count(&self) -> UInteger
pub fn count(&self) -> UInteger
Get the count of objects in the array.
C++ equivalent: UInteger count() const
Sourcepub fn object_enumerator(&self) -> Option<Enumerator<T>>
pub fn object_enumerator(&self) -> Option<Enumerator<T>>
Get an enumerator for the objects in the array.
C++ equivalent: Enumerator<Object>* objectEnumerator() const