NSMutableArray(GBMutableArray) Category Reference
Declared in | NSArray+GBArray.h NSArray+GBArray.m |
Tasks
Other Methods
-
– push:
Helper method for adding the given object to the end of the receiver. -
– pop
Helper method to removing the last object from the receiver. -
– peek
Helper method for looking at the last object in the receiver.
Other Methods
Instance Methods
peek
Helper method for looking at the last object in the receiver.
- (id)peek
Return Value
Returns the last object in the receiver.
Discussion
Internally, the method sends the receiver lastObject
message and returns the result. If the receiver is an empty array, nil
is returned.
Declared In
NSArray+GBArray.h
pop
Helper method to removing the last object from the receiver.
- (id)pop
Return Value
Returns the object removed from the receiver.
Discussion
Internally the method sends the receiver removeLastObject
and returns the removed object. If receiver is an empty array, exception is raised.
Exceptions
- NSException
- Raised if the receiver is an empty array.
Declared In
NSArray+GBArray.h
push:
Helper method for adding the given object to the end of the receiver.
- (void)push:(id)object
Parameters
- object
- The object to push to the end of the receiver.
Discussion
Internally the method sends the receiver addObject:
, but using this method makes usage of array as stack more obvious.
Declared In
NSArray+GBArray.h