Objective-C++ 的支持程度如何? [英] How well is Objective-C++ supported?

查看:34
本文介绍了Objective-C++ 的支持程度如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在通过 Hillegass 书,我突然想到使用 Objective-C++ 可能会更好.Objective-C 似乎是开发 UI 的明确选择,但我有很强的 C++ 背景,并且喜欢用 C++ 开发应用程序后端并使用 Objective-C++ 进行 UI 集成.但我想知道 Apple 会继续开发 Objective-C++ 还是会走到死胡同.

I've been learning Objective-C and Cocoa by working my way through the Hillegass book and it occurs to me that I might be better off using Objective-C++. Objective-C seems like the clear choice for developing UIs but I have a very strong C++ background and would love to develop application back-ends in C++ and use Objective-C++ to do the UI integration. But I wonder if Apple will keep developing Objective-C++ or will it become a dead end.

有人在使用 Objective-C++ 吗?

Is anyone out there using Objective-C++?

推荐答案

免责声明:我不代表 Apple 工作或发言,所以这是我的意见:

Disclaimer: I don't work or speak for Apple, so this is my opinion:

我不能代表主要的开发商店,但在我的小组中,我们已经使用 Objective-C++ 来集成 C++ 库,并且正如您建议的那样用 C++ 编写后端.正如@alxp 所提到的,像跨语言边界的异常处理之类的事情是痛苦的,但只要稍加计划,大多数这些痛苦是可以避免的.对于有经验的 C++ 开发者来说,收获是值得的.

I can't speak for the major dev shops, but in my small group, we've used Objective-C++ both for integrating C++ libraries, and as you propose for writing backends in C++. As @alxp mentions, things like exception handling across the language boundary are painful, but with a little planning, most of these pains can be avoided. For experienced C++ devs, the gains can be well worth the pain.

就支持而言,我认为您可以假设目前的支持不会很快消失.它是 GCC 代码库的一部分,Clang 工具链(Apple 的下一个编译器工具链)完全支持 Objective-C++.另一方面,没有任何官方保证 Apple 会继续开发集成——例如修复一些缺陷.

In terms of support, I think you can assume that support in its current state won't go away any time soon. It's part of the GCC code base and the Clang toolchain (Apple's next compiler toolchain) fully supports Objective-C++. On the other hand, there isn't any official guarantee that Apple will continue to develop the integration—fixing some of the warts, for example.

对于当前的项目,我会说如果使用 Objective-C++ 有好处,那么依赖现有的支持是安全的,你应该使用它.

For current projects, I would say that if using Objective-C++ provides benefit, it is safe to rely on the existing support and you should use it.

这篇关于Objective-C++ 的支持程度如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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