FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSAEnumerator.h
Go to the documentation of this file.
1 //
2 // NSAEnumerator.h
3 // FoundationExtension
4 //
5 // Created by Jeong YunWon on 2014. 9. 21..
6 // Copyright (c) 2014년 youknowone.org. All rights reserved.
7 //
8 
14 #import <Foundation/Foundation.h>
15 
19 @interface NSAInfiniteEnumerator : NSEnumerator {
20  id _pool[16];
21 }
22 
26 - (instancetype)initWithObject:(id)object;
30 + (instancetype)enumeratorWithObject:(id)object;
31 
32 @end
33 
37 @interface NSARangeEnumerator : NSEnumerator {
38  NSRange _range;
39 }
40 
45 - (instancetype)initWithCount:(NSUInteger)count;
49 - (instancetype)initWithRange:(NSRange)range;
50 
51 + (instancetype)enumeratorWithCount:(NSUInteger)count;
52 + (instancetype)enumeratorWithRange:(NSRange)range;
53 
54 @end
55 
56 
57 #if NS_BLOCKS_AVAILABLE
58 
61 typedef id (^NSABlockEnumeration)(NSUInteger index, BOOL *stop);
65 @interface NSABlockEnumerator : NSEnumerator {
67 }
68 
72 @property(nonatomic,copy) NSABlockEnumeration block;
73 
77 - (instancetype)initWithBlock:(NSABlockEnumeration)block;
81 + (instancetype)enumeratorWithBlock:(NSABlockEnumeration)block;
82 
83 @end
84 #endif
This enumerator generate number through a range.
Definition: NSAEnumerator.h:37
id _pool[16]
Definition: NSAEnumerator.h:20
id(^ NSABlockEnumeration)(NSUInteger index, BOOL *stop)
Enumeration block for NSABlockEnumerator.
Definition: NSAEnumerator.h:61
NSABlockEnumeration block
block
Definition: NSAEnumerator.h:66
NSRange _range
Definition: NSAEnumerator.h:38
Infinite loop.
Definition: NSAEnumerator.h:19
Enumerator using block.
Definition: NSAEnumerator.h:65