1
votes

In a cocoa application i have created a storyboard with one nswindowcontroller to control window and onew nsviewcontroller to control view. That view contain several buttons. The implicit call flow of these methods is like:

  1. instantiating nswindowcontroller from calling method
  2. implicit call to init method of nswindowcontroller
  3. implicit call to init method of nsviewcontroller

Now what i required to display some buttons from those several buttons on behalf of some parameters which is needed to send to the nsviewcontrollerclass. Can anyone please help me to achieve this.

1

1 Answers

3
votes

You will need to keep outlets to these buttons in your view controller. And depending on your business logic, you need to ensure, which button should be shown/hidden.

You can write a setUpButtons() function in the view controller. And the view controller can have an attribute or attributes to hold the parameter/s. Whenever you set these parameters, you need to call the setUpButtons() method to do the required showing/hiding of buttons.