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

Re: NSProgressIndicator, MUST use threads?


  • Subject: Re: NSProgressIndicator, MUST use threads?
  • From: Malte Tancred <email@hidden>
  • Date: Tue, 14 Dec 2004 14:20:02 +0100

On Dec 14, 2004, at 3.21, Matthew wrote:
//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?

Yes. You can issue a delayed perform? Like this:

- (IBAction)toggleSpinning:(id)sender {
if (!isSpinning) {
[self performSelector:@selector(startSpinning) withObject:nil afterDelay:0.0];
} else {
[self performSelector:@selector(stopSpinning) withObject:nil afterDelay:0.0];
}
}


- (void)startSpinning {
	[pole startAnimation:self];
	isSpinning = YES;
}

- (void)stopSpinning {
	[pole stopAnimation:self];
	isSpinning = NO;
}

You could of course send the message to the progress indicator directly as well (that is [pole performSelector:@selector(startAnimation:) withObject:self afterDelay:0.0]).

Regards,
Malte

--
Malte Tancred
Computer Programmer
Oops AB, http://oops.se/

_______________________________________________
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>
References: 
 >NSProgressIndicator, MUST use threads? (From: Matthew <email@hidden>)

  • Prev by Date: Resizing window on second screen makes window disappear
  • Next by Date: Re: Handling right click only
  • Previous by thread: Re: NSProgressIndicator, MUST use threads?
  • Next by thread: Re: NSProgressIndicator, MUST use threads?
  • Index(es):
    • Date
    • Thread