开发者

Why does [NSOutlineView clickedRow] always return -1?

开发者 https://www.devze.com 2022-12-30 03:16 出处:网络
I have a fairly pedestrian non-editable NSOutlineView setup. In the bindings for the outline view, I have set the Double Click Target binding to my file\'s owner (MyDocument FWIW) with a selector of o

I have a fairly pedestrian non-editable NSOutlineView setup. In the bindings for the outline view, I have set the Double Click Target binding to my file's owner (MyDocument FWIW) with a selector of outlineViewWasDoubleClicked

The method exists and is called, but when I call -clickedRow it consistently returns -1 rather than the row number of the row that I double clicked to trigger the method.

My _outlineView is an IBOutlet and I've verified that it is hooked up correctly by using -selectedRow for the method rather than -clickedRow (I would rather use -clickedRow though because it seems unintuitive for the user to have a row selected, double click another row to do something with it and have the method triggered with the ro开发者_如何学Gow they had selected.)

My best guess right now is that the -clickedRow value is getting cleared out before my method fires, but I don't know where or what might be gobbling it up.

Thanks in advance for any help.


Sounds like a bug to me. I suggest filing it and, in the meantime, setting the view's target and double-click action in code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号