• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Thread usage : Main thread interrupting secondary thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Thread usage : Main thread interrupting secondary thread
      • From: Miles <email@hidden>
  • Prev by Date: Re: Disabling key bindings
  • Next by Date: Re: Question about the Foundation Framework
  • Previous by thread: Re: Question about the Foundation Framework
  • Next by thread: Re: Thread usage : Main thread interrupting secondary thread
  • Index(es):
    • Date
    • Thread