Skip to content

Instantly share code, notes, and snippets.

@bentford
Created May 10, 2013 23:07
Show Gist options
  • Save bentford/5558108 to your computer and use it in GitHub Desktop.
Save bentford/5558108 to your computer and use it in GitHub Desktop.
The easiest way to implement NSFastEnumeration is to build your custom collection on top of NSFoundation collections.
#pragma mark - NSFastEnumeration
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(__unsafe_unretained id [])buffer count:(NSUInteger)len
{
return [dictionary.allValues countByEnumeratingWithState:state objects:stackbuf count:len];
}
#pragma mark -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment