Lan Yi iOS Training log 16 dictionary

Source: Internet
Author: User

Dictionaries and arrays are divided into mutable and immutable

Self-created general for variable (in-load data)

Use other people's general as immutable (take data from it)

Interview question: What can key in the dictionary write?

Generally we will write a string as key

The answer is: any object that complies with the Nscopy protocol can also be used in addition to the string NSNumber

Dictionaries and arrays can be nested with each other

A dictionary (nsdictionary,nsmutabledictionary) is a collection of data that consists of key-value pairs. As we look in the dictionary for the definition of a word.

By key (key), find the corresponding value (value), the key is usually a string object, it can be any other type of object. In a Dictionary object, the value of key must be unique.

In addition, the key and value of the Dictionary object cannot be null (nil), and if you need to include a null value in the dictionary, you can join the Nsnull object

Lan Yi iOS Training log 16 dictionary

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.