在 cocoa 中选择选项卡时自动调用的方法
我有一个选项卡视图,其中添加了 3 个选项卡视图项。在每个选项卡中,我都有要自动填充数据的字段。单击选项卡时会自动调用哪些方法。请帮助我...
I have a tabview in which i have added 3 tabview Items.In each tab i have fields into which i want to populate data automatically. Which methods are invoked automatically when a tab is clicked.Please help me in this...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NSTabView
允许您指定一个对象作为其委托。该委托对象应该是符合NSTabViewDelegate
协议的类的实例。除其他方法外,该协议还声明-tabView:willSelectTabViewItem:
来通知委托将要选择选项卡项;-tabView:didSelectTabViewItem:
通知委托已选择选项卡项。您可能想要实现
-tabView:willSelectTabViewItem:
以便在选择该选项卡项之前填充字段。NSTabView
allows you to specify an object as its delegate. This delegate object should be an instance of a class that conforms to theNSTabViewDelegate
protocol. This protocol declares, amongst others methods,-tabView:willSelectTabViewItem:
to inform the delegate that a tab item is about to be selected;-tabView:didSelectTabViewItem:
to inform the delegate that a tab item has been selected.You probably want to implement
-tabView:willSelectTabViewItem:
so that the fields are populated right before that tab item is selected.