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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to