Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by strizhmax ( 12 years ago )
@interface Tim : NSObject
{
 NSTimer *timer;
}

- (id)init;
- (void)timerFireMethod:(NSTimer *)timer;

@end

@implementation Tim

- (id)init
{
 self = [super init];
 timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES ];
 NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
 [runLoop addTimer:timer forMode:NSDefaultRunLoopMode];
 return self;
}

- (void)timerFireMethod:(NSTimer *)timerIn
{
 NSLog(@"Fire");
 Message m;
 if(canReceive(0, &m))
  canDispatch(&esc;_Data, &m);
 TimeDispatch();
}
@end

 

Revise this Paste

Your Name: Code Language: