Table Selection Persists even though Window Closed
Table Selection Persists even though Window Closed
- Subject: Table Selection Persists even though Window Closed
- From: K.Darcy Otto <email@hidden>
- Date: Wed, 1 Jul 2009 16:57:12 -0700
I have a document-based application that has, as its main UI element,
an NSTableView subclass. I want to disable menu items based on
whether the table has a row selected. I do this via -
validateUserInterfaceItem, and everything works under normal
circumstances: I check for a selected row with [myTable selectedRow],
and if I get a -1 (indicating no row is selected), the menu items are
disabled.
The problem: when I close all the document windows, but do not close
the application, and a row was selected prior to the last document
window being closed, [myTable selectedRow] reports whatever the last
row selected was, not -1 (even though it is not possible for a row to
be selected, because there is no table in an open window).
What might be of help in diagnosing this problem: when I issue
[[myTable window] firstResponder], the first responder is myTable
(even though the window is closed).
Anybody know of a solution to this problem? I have a feeling my whole
approach may be off, but I'm not sure. Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden