Skip to content
Browse files

Added after delay performSelector support

  • Loading branch information...
1 parent fde8c5c commit 2efa37ad69c9eab36c73d577c26c9ab2876c5ca9 @MugunthKumar committed Mar 26, 2011
Showing with 9 additions and 0 deletions.
  1. +1 −0 MKAdditions/NSObject+MKBlockAdditions.h
  2. +8 −0 MKAdditions/NSObject+MKBlockAdditions.m
View
1 MKAdditions/NSObject+MKBlockAdditions.h
@@ -14,5 +14,6 @@
}
- (void) performBlock:(VoidBlock) block;
+- (void) performBlock:(VoidBlock) block afterDelay:(NSTimeInterval) delay;
@end
View
8 MKAdditions/NSObject+MKBlockAdditions.m
@@ -20,6 +20,14 @@ - (void) performBlock:(VoidBlock) aBlock
[self performSelector:@selector(callBlock)];
}
+- (void) performBlock:(VoidBlock) aBlock afterDelay:(NSTimeInterval) delay
+{
+ [_block release];
+ _block = [aBlock copy];
+
+ [self performSelector:@selector(callBlock) withObject:nil afterDelay:delay];
+}
+
-(void) callBlock
{
_block();

0 comments on commit 2efa37a

Please sign in to comment.
Something went wrong with that request. Please try again.