I am writing a, primarily, c++ ios app.
I am using a c++ 3d engine and a dependence injection library. I know I have to do a bit of cocoa to embed the 3d engine into the view and I plan on using the Apple api for the touch input.
In order to keep maximal cross-platform compatibility, should I be using to MVC approaches – a Cocoa one to handle the basic view embedding and gestures and a second c++ one to handle all of the interaction and data that constitutes the bulk of the application?
Is there a good MVC library for c++ that could handle both or is well suited to the combination.
I am very new to this all. Apple makes it easy to use their tools but I really want to keep the code cross-platform.
Cocoa Touch is an MVC Framework. (I am assuming you’re doing an iOS application). I would think that you would create a subclass of UIView to render your 3d image and glue the 3d engine’s input and output to the view via a UIViewController.
Since I’ve never used C++ with Objective C, I can’t tell you how that’s done. The Apple implementation of Objective C is not portable across platforms. You would probably have to write some shim code between the library and your Xcode application and link the library in statically.
Also, if you’re building an iOS app, there are lots of details to building, and submitting an app to the app store…
The Xcode documentation is your friend.