Add unscheduled NSTimer block initializer.

This commit is contained in:
Frederik Seiffert 2021-03-03 05:24:17 +01:00 committed by Frederik Seiffert
parent ebfd7a2bea
commit 172e75b865
3 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2021-03-03 Frederik Seiffert <frederik@algoriddim.com>
* Headers/Foundation/NSTimer.h:
* Source/NSTimer.m: add unscheduled NSTimer block initializer
2021-02-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSXML.m:

View file

@ -93,6 +93,10 @@ GS_EXPORT_CLASS
userInfo: (id)info
repeats: (BOOL)f;
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
repeats: (BOOL)f
block: (GSTimerBlock)block;
- (void) fire;
- (NSDate*) fireDate;
- (void) invalidate;

View file

@ -197,6 +197,16 @@ static Class NSDate_class;
repeats: f]);
}
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
repeats: (BOOL)f
block: (GSTimerBlock)block
{
return AUTORELEASE([[self alloc] initWithFireDate: nil
interval: ti
repeats: f
block: block]);
}
/**
* Create a timer which will fire after ti seconds and, if f is YES,
* every ti seconds thereafter. On firing, invocation will be performed.<br />