How can I find out when a NSTabViewItem has been changed, i.e. a user has changed the view of an NSTabView?
Ideally I want to generate a notification but any solution would be welcome.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My original answer suggested to observe
selectedTabViewItemofNSTabView, but that doesn’t seem to work (on testing I can only get it to observeNSKeyValueObservingOptionInitial).A probably smarter solution is to use a delegate. Implement
tabView:didSelectTabViewItem:in the relevant controller.Docs here.