Skip to content

Instantly share code, notes, and snippets.

@bencochran
Last active December 14, 2015 03:39
Show Gist options
  • Save bencochran/5022700 to your computer and use it in GitHub Desktop.
Save bencochran/5022700 to your computer and use it in GitHub Desktop.

Revisions

  1. bencochran revised this gist Feb 24, 2013. 2 changed files with 1 addition and 1 deletion.
    File renamed without changes.
    2 changes: 1 addition & 1 deletion gistfile2.m → NSNumber+Enumeration.m
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    @implementation NSNumber (Enumeration)
    - (void)times:(void (^)(NSUInteger index, BOOL *stop))block
    {
    BOOL stop = NO;
    BOOL stop = NO;
    for (NSUInteger index = 0; index < [self integerValue]; index++) {
    block(index, &stop);
    if (stop) break;
  2. bencochran created this gist Feb 24, 2013.
    3 changes: 3 additions & 0 deletions gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    @interface NSNumber (Enumeration)
    - (void)times:(void (^)(NSUInteger index, BOOL *stop))block;
    @end
    10 changes: 10 additions & 0 deletions gistfile2.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    @implementation NSNumber (Enumeration)
    - (void)times:(void (^)(NSUInteger index, BOOL *stop))block
    {
    BOOL stop = NO;
    for (NSUInteger index = 0; index < [self integerValue]; index++) {
    block(index, &stop);
    if (stop) break;
    }
    }
    @end