OC7 (iterating over the collection, sorting the array)

Source: Internet
Author: User
1, what is the method of accessing an element or object in an array?  OBJECTATINDEX2, the syntax for accessing elements in an array of sugars? Array Object [subscript]3, how to access value in a dictionary? ObjectForKey4, dictionary access is worth the syntax sugar? Dictionary objects [Key]5, three convenient methods are for loop array loop set loop 6, enumerator nsarray *enumarray = @[@ "Zhizhang", @ "Shabi", @ "Caonima", @ "CHUNLV"]; Nsenumerator *rator = [Enumarray objectenumerator];id object = nil; while (object = [Rator Nextobject]) {NSLog (@ "%@", object);} 7, for (< #type *object#> in < #collection #>) {
< #statements #>
}
The type *object type * Represents the object types obtained from the collection
object is just a name and only needs to satisfy the variable name naming law
Collection represents the collection of traversed, in which collection to traverse

Statwments the actions that need to be performed in a traversal, such as using an enumerated object to implement certain functions

OC7 (iterating over the collection, sorting the array)

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.