Why does Apple use Objective-C?

前端 未结 3 867
时光说笑
时光说笑 2021-02-11 16:29

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.

3条回答
  •  无人及你
    2021-02-11 17:24

    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.

提交回复
热议问题