苹果为什么要使用Objective-C? [英] Why does Apple use Objective-C?

查看:112
本文介绍了苹果为什么要使用Objective-C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么苹果公司决定对iPhone SDK使用Objective-C而不对C ++使用?

令我感到奇怪的是,他们不会选择比Objective-C更流行的语言.是因为想要在其应用程序中拥有某些独一无二的东西,而这在其他情况下通常不会使用?

解决方案

在90年代,Apple与NeXT合并,而Mac OS X是由NeXT的操作系统NeXTSTEP制成的. Objective-C是NeXTSTEP应用程序框架的正式语言,该框架后来成为Mac OS X的Cocoa.然后将Mac OS X改编为iPhone OS,并将Cocoa改制成Cocoa Touch.在整个过程中,Objective-C都保持了良好的状态,并且很多Cocoa的功能都很难转换为C ++.

从本质上讲,它们全部来自NeXT.

Why did Apple decide to use Objective-C for the iPhone SDK and not C++?

It seems strange to me that they would not have chosen a language more popular than Objective-C. Is it because wanted to have something unique in their application which is not otherwise in general use?

解决方案

Apple merged with NeXT in the '90s and Mac OS X was made from NeXT's operating system, NeXTSTEP. Objective-C was the official language of NeXTSTEP's application frameworks, which became Mac OS X's Cocoa. Mac OS X was then adapted into the iPhone OS, and Cocoa was made into Cocoa Touch. Objective-C has held up pretty well all along the way, and a lot of Cocoa's features would be difficult to translate into C++.

So essentially, it all comes from NeXT.

这篇关于苹果为什么要使用Objective-C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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