• 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
run loop problem (i think)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

run loop problem (i think)


  • Subject: run loop problem (i think)
  • From: Ken Victor <email@hidden>
  • Date: Wed, 11 May 2005 15:29:31 -0700

given the following (summary)in my main thread:

[NSThread detachNewThreadSelector: @selector(doSteps:)
		toTarget: self
		withObject: nil];
[NSApp runModalForWindow: [controller window]];


and

- (void) doSteps: (id) unused {
	NSAutoreleasePool* arp = [[NSAutoreleasePool alloc] init];
	...
	[NSApp performSelectorOnMainThread: @selector(stopModal)
			withObject: nil
			waitUntilDone: NO];
	[arp release];
	}

ie, i start a thread and then run a modal window. the last thing my thread does before returning is to call NSApp stopModal (and then releases its aur release pool).

the problem is that my code following the call to runModalForWindow doesn't execute until i click the mouse or type a key on the keyboard.

(note that i've tried calling stopModal directly in my thread as opposed to via performSelectorOnMainThread and it doesn't solve the problem. i've also unsuccessfully tried pass YES as the waitUntilDone argument.)

can anyone give me any ideas as to what is causing this behavior, or more importantly how i can avoid it?

thanx,
ken
_______________________________________________
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: run loop problem (i think)
      • From: Bob Ippolito <email@hidden>
  • Prev by Date: Re: How to draw keyboard focus ring around a custom control?
  • Next by Date: NSRunAlertPanel with checkbox?
  • Previous by thread: Re: Core Data and NSFetchRequest
  • Next by thread: Re: run loop problem (i think)
  • Index(es):
    • Date
    • Thread