kiran Kumar Katuru
kiran Kumar Katuru

Reputation: 66

methods which are invoked automatically when a tab is selected in cocoa

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...

Upvotes: 1

Views: 1665

Answers (1)

user557219
user557219

Reputation:

NSTabView allows you to specify an object as its delegate. This delegate object should be an instance of a class that conforms to the NSTabViewDelegate 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.

Upvotes: 4

Related Questions