ObjectiveSugar icon indicating copy to clipboard operation
ObjectiveSugar copied to clipboard

Added -all method to NSArray and NSSet

Open subramanianv opened this issue 11 years ago • 8 comments

Added the method (BOOL) -all:(block)

This is my first commit to an open source project. Let me know if I have to fix anything

subramanianv avatar Feb 14 '14 07:02 subramanianv

duplicate #68

supermarin avatar Feb 14 '14 20:02 supermarin

I am newbie here. Is this a duplicate pull request ?

subramanianv avatar Feb 14 '14 20:02 subramanianv

@subramanianv it's implemented in #68, but not merged in yet. I'm not sure if it'll make it in master tho.

supermarin avatar Feb 14 '14 21:02 supermarin

@supermarin, what do you mean "it's implemented in #68"? #68 is an issue, not a pull. I'd like this feature too.

jonahb avatar Mar 11 '14 22:03 jonahb

The [NSArray all:] and [NSArray any:] methods are two that I really miss from Python. I'd vote for this to go in.

http://docs.python.org/2.7/library/functions.html#all

shepting avatar Mar 27 '14 23:03 shepting

Maybe use the enumerateObjectsWithOptions:usingBlock method though to allow concurrent checking of all the items in the block.

shepting avatar Mar 27 '14 23:03 shepting

That would be slower than a loop in most cases.

jonahb avatar Mar 28 '14 00:03 jonahb

I'm sorry for the misunderstanding, was probably tired and closed the wrong PR / issue. Closing #68, reopening this one

supermarin avatar Mar 28 '14 03:03 supermarin