tags:

views:

99

answers:

4

I was told that the newest Qt is Cocoa based, and as so, it's 64 bit. And Cocoa is Object-C based, whereas Qt is C++ based.

  • How is that possible? I mean, how C++ based library can turn into Objective-C related one? Is this just using Objective-C++?
  • Can any C++ library be Cocoa based using Objective-C++?
+1  A: 

Objective C is a strict superset of C. That means any valid C program is compilable with an Objective C compiler. Since C++ is backwards compatible with C, connecting them is fairly trivial. The C++ part just needs to be aware of some of Objective C's runtime libraries.

Cogwheel - Matthew Orlando
+1  A: 

Qt is C++, period. Interfacing one language with another (in this case C/C++/Objective-C/Objective-C++) can be quite straightforward.

Qt uses Cocoa by default, but can still be 32-bit, see http://doc.qt.nokia.com/4.7-snapshot/developing-on-mac.html for some general mac specific info.

rubenvb
+2  A: 

Objective-C++ lets you combine C++ and Objective-C in the same source file. So you can do interesting things here. For example, I've created C++ classes that call Cocoa things like NSNotification before.

So I suspect you'd just write in C++, calling C++ objects... which are implemented as C++ wrappers of Objective-C methods.

wxWidgets has a similar thing going on, wxCocoa, but last I heard that was the Mac platform of the future, meaning that they are still building it.

RyanWilcox
+1  A: 

Qt. Mixing Cocoa and Qt is easy peasy: http://www-sop.inria.fr/dream/blog/2009/03/mixing-cocoa-and-qt-through-carbon/

cheez