Nsarray unchangeable array-objective-C

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.