The C Family

The Connection to Open Source


Home Darwin Open Source PDF Oracle Objective-C QT C++ Projects

Software developers that have been exposed to Objective-C soon discover that innovative projects can easily be created without the fear of slamming into a brick wall; or worse (memory pointers as in C++). In fact, the designers of Java credit Objective-C as one of the influences that led to the creation of Java. You'll notice a lot of similarities between Objective-C and Java (e.g., both have a root 'object' class).

Incorporating C into Objective-C is simple. C blends well within Objective-C. Incorporating C++ into Objective-C (i.e., 'Objective-C++') is a different matter. Fortunately Cocoa understands Objective-C++; you can call native C and C++ code from Cocoa.

The following is Objective-C++ source code: containing a mixture of Objective-C and C++. Objective-C and C++ can work well together, keeping in mind that they're both distinct creatures and habits.

The output:

[/Users/Ric/workarea/myTemp]./hello
Hello, world!
Bonjour, monde!

Trolltech's Qt C++ library offers cross-platform development upon the GNU Compiler Collection and can be incorporated into Apple's Xcode IDE. Qt mimics Objective-C via incorporating 'signals' and 'slots' for GUI widgets to communicate with C++ methods.