An array is a set of ordered objects. In general, elements in an array are of the same type. Similar to variable strings and immutable strings, Arrays can also be variable or immutable.
Common nsarray immutable array Methods
+ (ID) arraywithobjects: obj1, obj2,... nil |
Create a new array, obj1, obj2...... is its element object, ending with nil object |
-(Bool) containsobject: OBJ |
Determine whether the array contains the object OBJ |
-(Nsuinteger) count |
Returns the number of array elements. |
-(Nsuinteger) indexofobject: OBJ |
The first index number that contains the OBJ Element |
-(ID) objectatindex; I |
Returns the object stored in location I. |
-(Void) makeobjectsperformselector :( SEL) Selector |
Send a message containing only the selector to each element in the array. |
-(Nsarray *) sortedarrayusingselector :( SEL) Selector |
Sort the array according to the comparison method indicated by Selector |
-(Bool) writetofile: path atomically :( bool) Flag |
Writes the array to the specified file. If the flag is yes, you must first create a temporary file. |