Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface timerClass : NSObject {
- int count;
- }
- -(void)printf:(NSTimer *)timer;
- @end
- @implementation timerClass
- -(void)printf:(NSTimer *)timer
- {
- count++;
- if(count < 10)
- printf("Called");
- }
- @end
- int main(int argc, char *argv[])
- {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:[[[timerClass alloc] init] autorelease] selector:@selector(printf:) userInfo:nil repeats:YES];
- [[NSRunLoop currentRunLoop] run];
- [pool drain];
- return 0;
- }
Add Comment
Please, Sign In to add comment