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
runModalForWindow
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
runModalForWindow
Subject
:
runModalForWindow
From: John Stiles <
email@hidden
>
Date: Tue, 25 Oct 2005 22:05:02 -0700
I wrote some code today and found a bug, but I'm not sure if the bug was mine or Apple's. I already found another (cleaner) way to do what I wanted to do, so I don't need ideas for alternate implementations, but I'm trying to decide whether I should file a radar or not. Here's the scoop:
- I have a NSWindow visible with a WebView, NSTextField, a progress bar, and buttons; the user can interact with it.
- I have a second thread running which is doing work and occasionally calling performSelectorOnMainThread to update the progress bar and text fields.
- In some situations, my performSelectorOnMainThread selector was deciding that we temporarily needed to go modal, and calling NSApp's -runModalForWindow: on my window.
The problem here was that, if the user is in the middle of resizing the window at the point when the performSelectorOnMainThread selector decided to call -runModalForWindow:, the window got into a really funky state. It pretty much froze up and wouldn't respond to clicks. Other updates that my main-thread selector had sent to the window during the resize operation, such as updating the progress bar or changing text in an NSTextField, also seemed to fall through the cracks entirely. (Normally, they all seemed to get applied as soon as the resize operation completed.) I found that I could sometimes "unstick" the window by focusing another application and then refocusing on my app; at this point the maximize button of my window would become responsive, and once I maximized the window, it sprung back to life and all the pending updates, like progress bar updates and NSTextField content changes, got applied all at once.
This really sounds like a bug in -runModalForWindow: to me, but I know that my usage is unorthodox--typically, you make a window modal when it's first becoming visible, before the user has had a chance to start interacting with it. (In the final version, FWIW, I managed to avoid going modal at all.) So is this a Cocoa bug, or is it my fault for abusing the system?
_______________________________________________
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: runModalForWindow
From:
John Stiles <email@hidden>
References:
>
beeps in response to key presses
(From: Steve Checkoway <email@hidden>)
Prev by Date:
Default sort column for NSTableView and NSArrayController
Next by Date:
Re: Newbie Question: Find spaces inside a string
Previous by thread:
beeps in response to key presses
Next by thread:
Re: runModalForWindow
Index(es):
Date
Thread