Search code examples
macoscocoanstextfield

Cocoa - Multiple NSControls working but not NSTextFields


I am new to using interface builder, and am building for Mac OS X. I have a NSTableView in my main window, the NSTableCellView subclasses of which each have their own set of controls. All of these controls (there are sliders, buttons, etc.) work properly (they call the appropriate action method when I use them), except the NSTextFields, which for some reason I can't even select or edit. The setting in IB clearly indicate they should be editable. The view controller supports the NSTextFieldDelegate protocol, and I've implemented the -(BOOL)acceptsFirstResponder method in the view controller to return YES.

Why aren't the text fields responsive?


Solution

  • For whatever the reason, turning off (row) highlighting solves the problem, as specified in https://stackoverflow.com/questions/7101237/respond-to-mouse-events-in-text-field-in-view-based-table-view. I'm not sure what to do if one wanted highlighting, however...