IOS uses the following to mark members in a multidimensional array

Source: Internet
Author: User
Tags arrays

The first is the most common one-dimensional array:


Defining a one-dimensional array
Nsarray *array1 = @[@ "0", @ "1", @ "2"];
A member in an array based on the subscript
NSLog (@ "%@", array1[0]);

Then the two-dimensional array:


Defining two-dimensional arrays
Nsarray *array2 = @[@[@ "00", @ "01", @ "02"],@[@ "10", @ "11", @ "12"]];
A member in an array based on the subscript
NSLog (@ "%@", array2[1][0]);

followed by three-dimensional arrays:


Defining three-dimensional arrays
Nsarray *array3 = @[@[@[@ "000", @ "001", @ "002"]],@[@[@ "100", @ "101", @ "102"]];
A member in an array based on the subscript
NSLog (@ "array3 =%@", array3[1][0][2]);

Why would you think of that? Because the C language is based on the subscript in the two-dimensional array of members, and then I would like to try the OC in the array of objects can do, did not think of is not only can, multidimensional array is also available, just a little more complicated.

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.