Re: Fast enumeration question.

2015-05-17 Thread dangerwillrobinsondanger
As others already noted the standard way is using the continue keyword. However, if the conditional inside is scoped high enough, you can also just use a guard if () {} Putting everything inside the if block. Then like any guard it's going to do nothing if the condition is false. Most Objectiv

Re: Fast enumeration question.

2015-05-14 Thread Charles Srstka
On May 14, 2015, at 11:52 AM, William Squires wrote: > > Oh well, "continue" it is. Though you can still do it manually, if you want! > :) While that’s true, fast enumeration performs better. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Re: Fast enumeration question.

2015-05-14 Thread William Squires
Oh well, "continue" it is. Though you can still do it manually, if you want! :) On May 14, 2015, at 11:15 AM, 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 > l

Re: Fast enumeration question.

2015-05-14 Thread Alex Zavatone
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"]) {

Re: Fast enumeration question.

2015-05-14 Thread Roland King
'continue’ Just like other c loop constructs. > On 15 May 2015, at 12:09 am, Alex Zavatone 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 "

Re: Fast enumeration question.

2015-05-14 Thread William Squires
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 wrote:

Re: Fast enumeration question.

2015-05-14 Thread Mike Abdullah
You want: continue; Same as a regular for loop in C. > On 14 May 2015, at 18:09, Alex Zavatone 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