Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

begdev

macrumors newbie
Original poster
If I'm writing an application in C++ and using Cocoa, how exactly would I link checkboxes/text inputs/button clicks to my C++ code in Xcode?

I've only ever created command line applications, so I'm not sure about connecting it to a GUI.

Should I just use Objective-C?

Any help is appreciated, thanks.
 
You would use Objective C and it would talk to your C++ code.

In a nut shell: make a nib, layout your controls, add IBActions to your ObjC controller class and use the linked method to invoke your C++ function.

Code:
- (void)buttonClick:(id)sender {
    MyClass->func();
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.