How do you stop fast enumeration?

Viewed 3449

How would you stop fast enumeration once you have gotten what your looking for.

In a for loop I know you just set the counter number to like a thousand or something. Example:

for (int i=0;i<10;i++){
    if (random requirement){
        random code
        i=1000;
    }
}

so without converting the fast enumeration into a forward loop type thing (by comparing i to the [array count] how can you stop a fast enumeration in the process?

4 Answers
Related