什么是目标 C++? [英] What is Objective C++?

查看:30
本文介绍了什么是目标 C++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 Objective C++,我可以在 Xcode 中使用这种语言吗?

What is Objective C++ and can I use this language in Xcode?

推荐答案

Objective-C++ 只是混合了 Objective-C 类和 C++ 类(两个完全不相关的实体)的源代码.您的 C++ 代码将像以前一样工作,并且生成的可执行文件将与 Objective-C 运行时链接,因此您的 Objective-C 类也将工作.你绝对可以在 Xcode 中使用它——用 .mm 扩展名命名你的文件.

Objective-C++ is simply source code that mixes Objective-C classes and C++ classes (two entirely unrelated entities). Your C++ code will work, just as before, and the resulting executable will be linked with the Objective-C runtime, so your Objective-C classes will work as well. You can definitely use it in Xcode -- name your files with the .mm extension.

此外,您可能想阅读 Apple 关于 Objective-C++ 的文档(遗憾地被删除,但已存档).

Also, you might want to read Apple's (sadly deleted, but archived) documentation on Objective-C++.

这篇关于什么是目标 C++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆