Thread usage : Main thread interrupting secondary thread
Thread usage : Main thread interrupting secondary thread
- Subject: Thread usage : Main thread interrupting secondary thread
- From: Miles <email@hidden>
- Date: Thu, 5 Mar 2009 12:43:51 -0800
I'm new to using threads and hitting an unexpected issue.
*There is an object moving across the screen on a separate thread started
like this:*
[NSThread detachNewThreadSelector:@selector( startObjectsAnimation: )
toTarget:animationHelper withObject:nil];
* Then in animationHelper:*
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
animationTimer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self
selector:@selector(doAnimation: ) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:animationTimer
forMode:NSDefaultRunLoopMode];
[[NSRunLoop currentRunLoop] run];
[autoreleasepool release];
*Then I have another object that when touched, gets a fade animation applied
to it (on the main thread):*
CAAnimationGroup *anim = [AnimationCreatorUtil
createAnimationsForOnWayOut];
anim.delegate = tv;
[[tv.mview layer] addAnimation:anim forKey:@"fade"];
[tv.mview setAlpha:0];
This is happening on the main thread. However, when this fade animation is
applied on the main thread, the animation of the other object on the
secondary thread pauses for a really brief moment. Since they are happening
on different threads I'd expect neither of them to affect one another. What
could be causing this?
Thanks!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden