objective c - App modal NSPanel / sheet / dialog + NSThread == window hangs? -
I am in the midst of debugging a very unusual problem, and I was wondering if anyone could be It's going wrong:
In an controller class from NIB, I take an NSPanel from the same NIB, and then shows an application on an NSWindow (this code was created by hand in this code):
[[NSAPCitration ShareApp] Startup: myPanel modalForWindow: Windows ModemAgget: Automatically Dsecur: @ selector (Shitdidand: Return code: Sndrbinfo :) Sndrbinfo: zero]; [[NSAPC Sharing ShareApp] RunModelForvando: MyPlanel]; Now, when the "finish" button is clicked on that sheet, then some code is run to disable some buttons and to ensure that user input Valid (valid with a remote service) This thread has been removed from a different validator object: // Controller call: [Validate validation credits: Notify credits: @Selector (Validation) on object: ]; // Validate validator objectInfo: (SSL) notify the Selective On Object: (ID) Notification Object {// Builders with Parameters and Notify Information [[Nsthid Detected Selection: @Selector (Remote Validate) To-Tower: Self-Withd Object: info]; }
Next, when the legalization has ended, the validator indicates my controller object:
[notifyObject performSelectorOnMainThread: notifySelector withObject: results waitUntilDone : NO];
And then my controller object, the way the verifier object calls, drops the dialog:
- (zero) verification completed: ( ID) data {[[NSAPCirmation shared application] stopmodel]; [CreateTwitterPanel orderout: zero]; [[NSAPCimation Share Application] and Sheet: BOTTitpeter Return Refund Code: NSKButton]; } - (zero) sheetdind: (NSWindow *) sheet return code: (int) return code referenceInfo: (zero *) referenceinfo {m_returnCode = returnCode; } My problem : Although the panel is closed / disappears, the top NSAPP runodolphorvando:
will not show up until some system events will show the window that was showing the dialog. The window is not trying to move, resize, or do anything at any location, or otherwise the method of getting out of the sudden exit from the application and execution is to continue. I have confirmed that all the methods are being applied to the controller class, everyone is being applied to the main app thread.
An even more interesting clue is that the dialog has two controls, a WebView, and a NSTextField: even if I force to exit runModalForWindow:
By clicking on the window, the tabbing gets spoiled between two controls - it just never works again. It is like my event loop horked.
I have tried to change the verification, complete: to post an alert in the main thread instead, and I have also played with waitUntilDone
Task ExecutionistMineTrade
method, everyone has no effect.
Any thoughts?
From NSAPPLIC documentation:
Stop modal or stop model with codec Instead EbertModel should be used: When you have to stop a Model Event Loop from that event loop anywhere in addition to a callout. In other words, if you want to stop the loop in response to a user's actions within the model window, use the stopmodel; Otherwise, use abortModal for example, if you are running a separate thread from the main thread of the application kit or when you add the NSTM to NSTMM in the NSMDalPanelRunLoopMode mode of NFSNLop, then use the abortmodal.
So, I learned something today.
Comments
Post a Comment