• 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: Newbie question: How do I keep animations going NSProgressIndicator...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: How do I keep animations going NSProgressIndicator...


  • Subject: Re: Newbie question: How do I keep animations going NSProgressIndicator...
  • From: Eric Ocean <email@hidden>
  • Date: Thu, 30 Sep 2004 15:44:00 -0700

It's not working because the event loop isn't running, which is when the display methods are called.

Use an NSTImer instead that calls a method that spins the progress indicator until you set a flag when you're done sorting (before the "break" in your code).

Or use threads, and do the sort on another thread. That's a single method call; check the NSObject documentation.

There are probably other ways.

Eric Ocean

On Sep 30, 2004, at 3:26 PM, Berndt Jung wrote:

Below is a snippit of code.  I want he progress indicator to keep
"spinning" while it sorts the list.  As is, it stops as soon as it
hits the [dll ****sort] method call.

- (IBAction)sort:(id)sender
{
	[sortingIndicator startAnimation:self];
	[sortingIndicator displayIfNeeded];
	NSDate * now = [NSDate date];
	switch ([whichSort selectedTag]) {
		case 0:
			[dll selectionSort];
			break;
		case 1: [dll insertionSort];
			break;
		case 2: [dll mergeSort];
			break;
		default: [dll quickSort];
			break;
	}
	float secs = -1.0 * (float)[now timeIntervalSinceNow];

	[elapsedTime setFloatValue: secs];
	[sortingIndicator stopAnimation:self];
	//[dll printList];
}

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


This email sent to email@hidden


_______________________________________________ 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
  • Prev by Date: Re: Newbie question: How do I keep animations going NSProgressIndicator...
  • Next by Date: Boggled By Bindings
  • Previous by thread: Re: Newbie question: How do I keep animations going NSProgressIndicator...
  • Next by thread: Boggled By Bindings
  • Index(es):
    • Date
    • Thread