Hi All,
I need to create a dialog from a thread. Im loading a nib file within the thread using the "initwithwindowNibName" and trying to popup the dialog using "[nsapp runmodalforwindow]",but the dialog is not popping up..
Please help me out.
Hi All,
I need to create a dialog from a thread. Im loading a nib file within the thread using the "initwithwindowNibName" and trying to popup the dialog using "[nsapp runmodalforwindow]",but the dialog is not popping up..
Please help me out.
AppKit, the GUI framework, is not thread safe. In order for things to work properly, you (almost) always need to update GUI classes from the main thread
— Dave Dribin, Invoke on Main Thread
Basically, you'll want to do something like:
[objectThatShowsTheDialog performSelectorOnMainThread:@selector(showTheDialog:) withObject:anObject waitUntilDone:NO];
to call the code that puts up the dialog on the the main thread.