Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)startAnimation
- {
- NSThread* timerThread = [[NSThread alloc] initWithTarget:self selector:@selector(startAnimationThread) object:nil]; //Create a new thread
- [timerThread start]; //start the thread
- }
- //the thread starts by sending this message
- -(void) startAnimationThread
- {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSRunLoop* runLoop = [NSRunLoop currentRunLoop];
- [[NSTimer scheduledTimerWithTimeInterval: animationInterval
- target: self
- selector: @selector(drawView)
- userInfo: nil
- repeats: YES] retain];
- [runLoop run];
- [pool release];
- }
Add Comment
Please, Sign In to add comment