In Objective-C, is it possible to restart the first iteration of the for loop? I do not want to do anything with my objects until I find a “good” object, after which I want to go back and do everything with each object to this good object.
So,
bool someflag = false; for (id object in array) { if(object is good) { someflag = true;
Or is there another / better way to do what I'm trying to do?
Obviously, a simple way would be to simply have two separate for loops, so if I could get a second opinion telling me that the best way is what I will shoot for. For some reason, I have a feeling that there must be a better way.
source share