[source setAction: action]; [source setTarget: target];where source is the source object, target is the target object, and action is obtained by converting the action attribute into a selector.
Because objects which allow you to set an action normally have an action attribute, this connector is normally never used, since you would rather set the action of the source by using the action attribute of the source object, and then set the target of the source to the target object by using a standard outlet connector with key "target", or setting the object attribute target of the source to the target object. Please have a look at the examples which should make this clear.
<connectors> <control source="#myButton" target="#myController" action="buttonPressed:" /> </connectors>this is rarely used, because usually you can more simply do
<objects> ... <button action="buttonPressed:" target="#myController" ... /> ... </objects>this is equivalent, but it is preferred because it is much more natural: you set the action and the target of the button in the same place where you create the button, rather than in the separate connectors section. The system automatically writes all action connectors in this way when it writes gsmarkup files – if it can: if the source is not created in the gsmarkup file, this can't be done, and you would need to use a control connector explicitly.
[source takeValue: target forKey: key];where source is the source object, target is the target object, and label is the key. Often an outlet can be embedded directly into the objects section, which results in simpler, better code.
<connectors> <outlet source="#myController" target="#myButton" key="button" /> </connectors>this (in which the source is an object already existing in the application) is the only form of outlet connector which is normally used, because if the object is created in the gsmarkup file itself, the outlet can be embedded in the object creation by using the syntax
<objects> ... <textView delegate="#myController" ... /> ... </objects>which is perfectly equivalent to:
<objects> ... <textView id="myTextView" ... /> ... </objects> <connectors> <outlet source="#myTextView" target="#myController" key="delegate" /> </connectors>this second explicit form is much more long, artificial and cumbersome. The system automatically writes all outlet connectors inside the objects section when it writes gsmarkup files – if it can. In some cases (when the source is created outside the gsmarkup file) this can't be done; these are the cases in which the connector is created manually inside the connectors section.