Protocol for supporting fast enumeration in collections. One
principal advantage over NSEnumeration is that it is specified for
for
in
loops, meaning the enumerated object
need not be retained.
typedef struct
{
NSUInteger state;
id *itemsPtr;
NSUInteger *mutationsPtr;
NSUInteger extra[5];
} NSFastEnumerationState;
-count
- Returns number of items (experimentally added, makes NSFastEnumeration
basically NSContainer)-countByEnumeratingWithState:objects:count:
- Returns items in batches for enumeration
Note: This protocol replaces the older NSEnumeration protocol and is
optimized for the Objective-C for
..in
syntax.
The object being enumerated does not need to be retained during
enumeration.