Created
May 7, 2010 23:41
-
-
Save CastIrony/394145 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSObject+Blocks.h" | |
@interface CADisplayLink (Blocks) | |
+(CADisplayLink*)displayLinkWithBlock:(simpleBlock)block; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CADisplayLink+Blocks.h" | |
@interface CADisplayLink (Blocks) | |
+(CADisplayLink*)displayLinkWithBlock:(simpleBlock)block; | |
{ | |
return [displayLinkWithTarget:block selector:@selector(invokeBlock)]; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void(^simpleBlock)(void); | |
@interface NSObject (Blocks) | |
-(void)invokeBlock; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSObject+Blocks.h" | |
@implementation NSObject (Blocks) | |
-(void)invokeBlock | |
{ | |
simpleBlock blockToInvoke = (id)self; | |
blockToInvoke(); | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSObject+Blocks.h" | |
@interface NSTimer (Blocks) | |
+(NSTimer*)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(simpleBlock)block; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSTimer+Blocks.h" | |
@interface NSTimer (Blocks) | |
+(NSTimer*)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(simpleBlock)block | |
{ | |
return [NSTimer scheduledTimerWithTimeInterval:seconds target:block selector:@selector(invokeBlock) repeats:NO]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment