开发者

Cocoa Binding, how to ask 'view' side to scroll to selection

开发者 https://www.devze.com 2022-12-19 06:10 出处:网络
Currently, I\'m binding the NSArray to NSArrayController and then to a NSTableView, so the data and selection is working correctly, b开发者_如何学运维ut seems I can\'t tell table view to scroll to sel

Currently, I'm binding the NSArray to NSArrayController and then to a NSTableView, so the data and selection is working correctly, b开发者_如何学运维ut seems I can't tell table view to scroll to selection from NSArrayController. Do I have to add an NSTableView outlet?

I certainly can do that, but I'd try to see if there's a better way to avoid introducing UI controls to Controller side.


The job of the Controller is to sit between the Model and View and talk to both of them as needed. This means that, yes, you will have to make the Controller know of the View; this is both necessary and appropriate.

0

精彩评论

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