I'm writing an API, and I'm a firm believer of putting as much type safety as possible into APIs. Is there a @protocol
for things like NSSet, NSArray, etc that marks it as "iterable" in a for (foo in bar) {..}
style loop? At the moment I've got something like this:
- (void) doSomethingWith:(id)someItems;
When I'd like to have something along these lines:
- (void) doSomethingWith:(id <NSIterableCollection>)someItems;
Is it doable? Does wanting it make me some kind of static-typing weanie who has no place doing Obj-C? ;-)