有真正的东西像Objective C ++? [英] There is really something like Objective C++?

查看:145
本文介绍了有真正的东西像Objective C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读关于iPhone程式设计的讯息,我注意到谈论Objective C ++,在post中显示的代码主要看起来像Objective-C,但在C ++中也有几个片段。是否真的可能从C ++编程Cocoa?

I'm reading a post about iPhone programming and I've noticed that the talk about Objective C++, the code shown in the post looks mainly like Objective-C but there also are several snippets in C++. Is it really possible to program Cocoa from C++?

推荐答案

除了其他注释外,我补充说Objective-

In addition to the other comments, I would add that Objective-C++ is not exactly the same as "program Cocoa from C++" because there is no C++ to Cocoa bridge involved.

在Objective-C ++中,您可以使用Objective-C编程Cocoa API, C对象/语法。 Cocoa API保持不变,因此您需要以相同的方式(使用Objective-C字符串,Objective-C数组和Objective-C对象)与它进行通信。

In Objective-C++, you program the Cocoa API entirely with Objective-C objects/syntax. The Cocoa API remains unchanged, so you need to communicate with it in the same way (using Objective-C strings, Objective-C arrays and Objective-C objects).

与纯粹的Objective-C相比,Objective-C ++的区别在于,您还可以使用C ++对象(包含Objective-C对象,由Objective-C对象包含或者只是并排的Objective-C对象)。

The difference with Objective-C++, compared to plain Objective-C, is that you can also use C++ objects (containing Objective-C objects, contained by Objective-C objects or just along-side Objective-C objects).

这篇关于有真正的东西像Objective C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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