Removing object from NSMutableArray

Posted by Ben Packard on Stack Overflow See other posts from Stack Overflow or by Ben Packard
Published on 2010-05-03T09:08:06Z Indexed on 2010/05/03 9:18 UTC
Read the original article Hit count: 240

Filed under:
|
|

Just a small query...

I stumbled across the following shortcut in setting up a for loop (shortcut compared to the textbook examples I have been using):

for (Item *i in items){ ... }

As opposed to the longer format:

for (NSInteger i = 0; i < [items count]; i++){ ... } //think that's right

If I'm using the shorter version, is there a way to remove the item currently being iterated over (ie 'i')? Or do I need to use the longer format?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c