Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More mismatched blocks.

  • Loading branch information...
commit 4e87d65e106186ec8231d31b1e295e6e38fcc622 1 parent adaa766
Paul Kim authored
Showing with 34 additions and 4 deletions.
  1. +26 −3 NSTimer-NoodleExtensions.m
  2. +8 −1 NoodleKit.xcodeproj/project.pbxproj
View
29 NSTimer-NoodleExtensions.m
@@ -49,19 +49,42 @@ + (NSTimer *)scheduledTimerWithAbsoluteFireDate:(NSDate *)fireDate target:(id)ta
+ (NSTimer *)scheduledTimerWithAbsoluteFireDate:(NSDate *)fireDate block:(NoodleTimerBlock)block
{
- return [self scheduledTimerWithAbsoluteFireDate:fireDate target:[NoodleGlue glueWithBlock:(NoodleGlueBlock)block] selector:@selector(invoke:) userInfo:nil];
+ NoodleGlue *glue;
+
+ glue = [NoodleGlue glueWithBlock:
+ ^(NoodleGlue *blockGlue, id object)
+ {
+ block(object);
+ }];
+
+ return [self scheduledTimerWithAbsoluteFireDate:fireDate target:glue selector:@selector(invoke:) userInfo:nil];
}
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(NoodleTimerBlock)block
{
- return [self scheduledTimerWithTimeInterval:seconds target:[NoodleGlue glueWithBlock:(NoodleGlueBlock)block] selector:@selector(invoke:) userInfo:nil repeats:repeats];
+ NoodleGlue *glue;
+
+ glue = [NoodleGlue glueWithBlock:
+ ^(NoodleGlue *blockGlue, id object)
+ {
+ block(object);
+ }];
+
+ return [self scheduledTimerWithTimeInterval:seconds target:glue selector:@selector(invoke:) userInfo:nil repeats:repeats];
}
+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(NoodleTimerBlock)block
{
+ NoodleGlue *glue;
+
+ glue = [NoodleGlue glueWithBlock:
+ ^(NoodleGlue *blockGlue, id object)
+ {
+ block(object);
+ }];
- return [self timerWithTimeInterval:seconds target:[NoodleGlue glueWithBlock:(NoodleGlueBlock)block] selector:@selector(invoke:) userInfo:nil repeats:repeats];
+ return [self timerWithTimeInterval:seconds target:glue selector:@selector(invoke:) userInfo:nil repeats:repeats];
}
- (id)initWithAbsoluteFireDate:(NSDate *)date target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo
View
9 NoodleKit.xcodeproj/project.pbxproj
@@ -115,7 +115,7 @@
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* NoodleKit */;
+ remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = NoodleKit;
};
/* End PBXContainerItemProxy section */
@@ -690,7 +690,14 @@
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "NoodleKit" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 0867D691FE84028FC02AAC07 /* NoodleKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
Please sign in to comment.
Something went wrong with that request. Please try again.