views:

90

answers:

1

Consider developing an application where the model will be written in C++ (with Boost), and the view will be written in Objective-C++ (with Cocoa Touch).

Where are some examples showing how to integrate C++ and Objective-C++ for developing iPhone applications?

+5  A: 

Take it straight from the source: Apple has documentation on using C++ With Objective-C.

There really isn't much more to it besides, in my opinion, trying to keep the C++ and Objective-C parts as cleanly seperated as possible.

In your case it comes natural:

  • limit definition of C++ classes et al to the C++ model
  • restrict the Objective-C part to the view related code and using the C++ model

I don't know of any actual simple examples, but any cross-platform project that has a native GUI on the mac uses the same approach. One mostly clean example would be the Chromium source.

Georg Fritzsche
Thanks for the pointer to Chromium.
Dave Jarvis