objc

NXArray.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXObject.h"
7 
9 // CLASS DEFINITIONS
10 
20 @private
21  void **_data;
22  size_t _length;
23  size_t _cap;
24 }
25 
31 - (id)initWithCapacity:(size_t)capacity;
32 
36 + (NXArray *)new;
37 
43 + (NXArray *)arrayWithCapacity:(size_t)capacity;
44 
55 - (id)initWithObjects:(id<RetainProtocol>)firstObject, ...;
56 
68 + (NXArray *)arrayWithObjects:(id<RetainProtocol>)firstObject, ...;
69 
74 - (unsigned int)count;
75 
85 - (size_t)capacity;
86 
91 - (id)firstObject;
92 
97 - (id)lastObject;
98 
110 - (BOOL)containsObject:(id)object;
111 
122 - (id)objectAtIndex:(unsigned int)index;
123 
130 - (unsigned int)indexForObject:(id<ObjectProtocol>)object;
131 
137 - (BOOL)append:(id<RetainProtocol, ObjectProtocol>)object;
138 
150  atIndex:(unsigned int)index;
151 
164 - (BOOL)remove:(id<RetainProtocol>)object;
165 
175 - (BOOL)removeObjectAtIndex:(unsigned int)index;
176 
185 - (void)removeAllObjects;
186 
195 - (NXString *)stringWithObjectsJoinedByString:
196  (id<NXConstantStringProtocol>)delimiter;
197 
198 @end
id lastObject()
Returns the last object in the array.
id firstObject()
Returns the first object in the array.
void removeAllObjects()
Removes all objects from the array.
bool BOOL
A Boolean value.
Definition: runtime.h:60
unsigned int count()
Returns the number of elements in the array.
size_t capacity()
Returns the capacity of the array.
A class for managing and manipulating string objects.
Definition: NXString.h:20
Defines the NXObject class, the base class for the Foundation framework.
The NXArray classNXArray represents an array that can store ordered objects.
Definition: NXArray.h:19
The base class for objects in the Foundation framework.
Definition: NXObject.h:21
A protocol that defines collection methods for an Object.
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
A protocol that defines JSON methods for an Object.
Definition: JSON+Protocol.h:14