0
What is fast enumeration in Objective-C?

Open 1 Answers 26 Views Technology
What is fast enumeration in Objective-C?

1 Answer

0

The object is usually a collection such as an array or set Several Cocoa classes, including the collection classes, adopt the NSFastEnumeration protocol. You use it to retrieve elements held by an instance using a syntax similar to that of a standard C for loop, as illustrated in the following example:

NSArray *anArray = // get an array;

for (id element in anArray)

{

/* code that acts on the element */

}

by (304k points)
...