How to provide your own sent messages in the Builder interface

I cannot find documents on how Interface Builder determines the outputs of sent messages for graphical connections between components that trigger events and messages of other components.
I want to generate components that encapsulate Finate State Automata. The input is simple, just define IBAction messages and you can connect them in Interface Builder. The difficult part is obviously the other end of such compounds.
I want to provide each event triggered by FSM with a separate outlet, for example, the "selector" outlet of NSButton (indicated in the "Sent Messages" section of the "Connections" tab of the inspector). How can I specify such interfaces programmatically and can I specify more than one of them? Or this approach is not suitable; Would notifications be better? (I use graphic connections from Visual Age and parts, so I would prefer them, but in the Builder interface support for such connections is somehow limited).

Thanks in advance

The first part of my question was addressed in the question "Submit Cocoa Action - IBAction". I'm still looking for an opportunity to define more than one "Sent Message".

+4
source share
1 answer

When you implement your method using IBActions, the object that generated the message (sender) is passed to the message. Therefore, if I have a button on my interface that says โ€œExitโ€ and an action on some controller object called logout: and I connected them, the method gets an instance of the button that called it. For instance:

 - (void)logout:(id)sender { // sender is the instance of whichever wired button triggered // this action. We just NSLog() it for now. NSLog(@"-[%@ logout:%@]", self, sender); } 

Other objects may also trigger this action and may convey themselves as a sender or may transmit zero. Details of this will be provided to you as a designer.

0
source

All Articles