This shouldn't be done in a loop.

Moreover, you should look if folder is a NSException instance - because the user could have deleted it. If that's the case, nothing should be done.