Just tested Mike's suggestion and "continue" does the trick.

Here's a test that verifies that..

 NSArray *myStuff = [[NSArray alloc]initWithObjects:@"A", @"B", @"Puppies", 
@"C",@"D", nil];
    
    for (NSString *myThing in myStuff) {
        if ([myThing isEqualToString:@"Puppies"]) {
            continue;
        }
        
        NSLog(@"%@",myThing);
        
    }
        
2015-05-14 12:19:10.422 test[6083:207] A
2015-05-14 12:19:10.423 test[6083:207] B
2015-05-14 12:19:10.423 test[6083:207] C
2015-05-14 12:19:10.424 test[6083:207] D



On May 14, 2015, at 12:15 PM, William Squires wrote:

> Not as far as I know; this is one of those times when you're better off doing 
> a manual loop with a regular for( ; ; ) {} statement; then you can test the 
> loop iterator with a switch() and take appropriate action (or none at all, if 
> desired.)
> 
> On May 14, 2015, at 11:09 AM, Alex Zavatone <z...@mac.com> wrote:
> 
>> I'm sure this will sound like the noobiest question ever, but with Fast 
>> Enumeration, if in an if statement within the loop, is there a way to stop 
>> loop execution and essentially do a "proceed to the next item in the list 
>> please"?
>> 
>> Interested in something like BASIC's next repeat or something to that effect.
>> 
>> In my scanning of the Apple docs, I didn't see that.  Does break do that or 
>> simply break out of the loop all together?
>> 
>> For example, if I'm counting from 1 to 10, hit 3, I want the loop to skip to 
>> 4 and keep going.
>> 
>> Thanks much.
>> _______________________________________________
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/wsquires%40satx.rr.com
>> 
>> This email sent to wsqui...@satx.rr.com
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to