问题描述
考虑开发那里的模型将用C ++编写(带升压)的应用程序,视图将在Objective-C ++(与可可触摸)被写入。
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).
在哪里是一些例子说明如何整合C ++和Objective-C ++开发iPhone应用程序?
Where are some examples showing how to integrate C++ and Objective-C++ for developing iPhone applications?
推荐答案
把它直接从源:苹果文档的使用C ++采用Objective-C的。
Take it straight from the source: Apple has documentation on using C++ With Objective-C.
实在没有更给它之外,在我看来,试图保持C ++和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:
- C ++类等,以C ++模型 极限定义
- 限制Objective-C的部分视图相关code和使用C ++模型
我不知道有任何实际的简单的例子,但对MAC的本地GUI的跨平台项目使用相同的方法。其中大多是干净的例子是。
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.
这篇关于语言混合:Model和View的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!