• 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
NSProgressIndicator, MUST use threads?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSProgressIndicator, MUST use threads?


  • Subject: NSProgressIndicator, MUST use threads?
  • From: Matthew <email@hidden>
  • Date: Mon, 13 Dec 2004 21:21:00 -0500

Hello,

I'm working on a toy example using an indeterminate progress indicator. Once a user clicks on a button, I call a method that should start the barber pole spinning, do some stuff, and then stop it when that stuff finishes.

The problem is that it's not spinning at all, not with startAnimation: or with a loop that repeatedly calls animate: to another progress indicator.

I notice that as long as the method that was called from the button press is actively running, that the button retains the focus (and appears pressed), so does that 'freeze' the view from other things rendering?

On the other hand, if I start it spinning in awakeFromNib and have the button press stop the spin, then it stops it fine.

Here's the relevant (and only) portion of code to be concerned with. It's set to be indeterminate and it does work. For instance, if I have this method start the spinning, the spinning starts and just keeps going. That's great except that I want it to spin while the method is actively running and stop when it finishes.

//this method obviously runs forever, but neither barber pole spins during that time.
- (IBAction)startSpinning:(id)sender
{
[barberPole startAnimation:nil];
while (TRUE) {
// [barberPole animate:nil];
[barberPole2 animate:nil];

}

}


Is there a way to get this to animate without using threads?
Matthew

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSProgressIndicator, MUST use threads?
      • From: Malte Tancred <email@hidden>
    • Re: NSProgressIndicator, MUST use threads?
      • From: Matthew <email@hidden>
  • Prev by Date: Re: Getting the visible glyph range
  • Next by Date: Re: awakeFromNib and File's Owner
  • Previous by thread: Re: How can I make Darwin see the most recent PHP from the shell prompt?
  • Next by thread: Re: NSProgressIndicator, MUST use threads?
  • Index(es):
    • Date
    • Thread