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)