FROM : I. Savant
DATE : Mon Mar 03 01:40:33 2008
> I have a NSButton and I would like to have some code executed when the
> button is clicked. Special circunstances for this is that my button is
> created purely in code, there are no nib files on the project and also
> no use of the Interface Builder, and nor can it be, because I'm
> developing a cross-platform library. I haven't found how to do that in
> those special circunstances.
This is covered in the introductory Cocoa material. See:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_5.html
The target/action mechanism works the same in code as it does in
IB. It's just that in code, you have to explicitly set the target/
action.
--
I.S.
DATE : Mon Mar 03 01:40:33 2008
> I have a NSButton and I would like to have some code executed when the
> button is clicked. Special circunstances for this is that my button is
> created purely in code, there are no nib files on the project and also
> no use of the Interface Builder, and nor can it be, because I'm
> developing a cross-platform library. I haven't found how to do that in
> those special circunstances.
This is covered in the introductory Cocoa material. See:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_5.html
The target/action mechanism works the same in code as it does in
IB. It's just that in code, you have to explicitly set the target/
action.
--
I.S.
| Related mails | Author | Date |
|---|---|---|
| Felipe Monteiro de… | Mar 3, 01:25 | |
| I. Savant | Mar 3, 01:40 | |
| Felipe Monteiro de… | Mar 3, 02:58 | |
| I. Savant | Mar 3, 03:04 | |
| I.Savant | Mar 3, 03:10 |






Cocoa mail archive

