Object-c Nsset Type

Source: Internet
Author: User

Nsset is also a collection that, in combination with arrays, can hold data of the object type as a dictionary.

The set collection cannot hold the same object, its elements are not the same, and they are stored in an unordered order.
Note: The same elements can be stored in the set collection, but the same elements will be left only one after running. As follows:
Nil is not stored in the set set because nil is a set-end flag.
Create a Nsset object

Nsset *Set=[nsset setwithobjects:@"1",@"2",@"1",@"3",@"4",@"2",@"5",@"3", nil];

        NSLog (@ "%@",set);
The results of the operation are as follows:
for:53.48110.29. 1 [558:15953] {( 3, 4, 5 , 1 , 2 )}
Common methods of Nsmutableset:
set]; // Create an empty collection        Nsmutableset *set2=[nsmutableset setwithcapacity:ten];        [Set1 AddObject: @""]; // adding elements        [Set1 removeobject:@ ""]; // Delete Element



Object-c Nsset Type

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.