OBJECTIVE-C Foundation Compaction--basic use of Set

Source: Internet
Author: User
Overview

The basis of the compaction of My Learning iOS development in the basic grammar of the knowledge of the summary series, not to be inquisitive, only practical. The content of this paper is to be used frequently in the development process of the collection class, due to lack of project experience, the first to think of some of the basic grammar often used to do a summary.

The main contents of this article are as follows:

1.NSArray

2.NSMutableArray

Nsarray

1. Create: The two commonly used methods are the following form. It is important to note that the elements in the nsarray that differ from Java,oc can be of different object types.

        ID obj1 = [[NSObject alloc]init];        ID obj2 = @ "Hushunfeng";        ID obj3 = @ "CMCC";                Nsarray *array = [Nsarray arraywithobjects:obj1,obj2,obj3,nil];        New syntax        Nsarray *array2 = @[obj1,obj2,obj3];

The first method of definition is defined by the class method, which is the beginning of the array, and this technique should be remembered, and it is also useful to define the init of the instance method, which is not described here.

OBJECTIVE-C Foundation Compaction--basic use of Set

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.