Objc Basic Learning Record 3

Source: Internet
Author: User

In learning objective-C,

Array

1. nsarray,

This is an immutable array. Objects in the array cannot be modified or deleted. Any objective object pointer can be stored.

INT and Char Types cannot be stored, and must be converted to the required type.

 

To quickly enumerate the values in the array, use in.

 
1 For(Nsstring * eleementInMyarray)2Nslog (@"Myarray is % @", Element );

2. nsmutablearray

This is a variable array. You can add or delete objects to it.

A. Add the addobject method.

[Mylistarray addobject: Str];

B. Delete removeobject

 
[Mylistarray removeobject: Str];

C. Modify replaceobjectatindex, an element in the array.

 
[Mylistarray replaceobjectatindex: Id withobject: Str];

D. inserobject insert element,

 
[Mylistarray insertobject: Str atindex: Id];

 

 

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.