PageRenderTime 42ms CodeModel.GetById 37ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/BlocksKit/NSMutableArray+BlocksKit.h

http://github.com/zwaldowski/BlocksKit
C++ Header | 50 lines | 6 code | 6 blank | 38 comment | 0 complexity | e7554d64a85c44f85f5f22dae22a9b42 MD5 | raw file
 1//
 2//  NSMutableArray+BlocksKit.h
 3//  %PROJECT
 4//
 5
 6#import "BKGlobals.h"
 7
 8/** Block extensions for NSMutableArray.
 9 
10 These utilities expound upon the BlocksKit additions
11 to the immutable superclass by allowing certain utilities
12 to work on an instance of the mutable class, saving memory
13 by not creating an immutable copy of the results.
14
15 Includes code by the following:
16 
17 - Martin Sch?rrer.  <https://github.com/MSch>.	 2011. MIT.
18 - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT.
19 
20 @see NSArray(BlocksKit)
21 */
22@interface NSMutableArray (BlocksKit)
23
24/** Filters a mutable array to the objects matching the block.
25 
26 @param block A single-argument, BOOL-returning code block.
27 @see reject:
28 */
29- (void)performSelect:(BKValidationBlock)block;
30
31/** Filters a mutable array to all objects but the ones matching the block,
32 the logical inverse to select:.
33 
34 @param block A single-argument, BOOL-returning code block.
35 @see select:
36 */
37- (void)performReject:(BKValidationBlock)block;
38
39/** Transform the objects in the array to the results of the block.
40 
41 This is sometimes referred to as a transform, mutating one of each object:
42	[foo map:^id(id obj) {
43	  return [dateTransformer dateFromString:obj];
44	}];
45 
46 @param block A single-argument, object-returning code block.
47 */
48- (void)performMap:(BKTransformBlock)block;
49
50@end