且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

苹果为什么要使用Objective-C?

更新时间:2022-12-11 14:50:03

在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.