Why does Apple use Objective-C?

前端 未结 3 870
时光说笑
时光说笑 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:32

    It's because Objective C has been the de facto language for Mac OS X development before it was Mac OS X. When Jobs left Apple to set up NeXT, the language Objective C was developed as a specific language that wasn't C++ and avoided many of its pitfalls. It therefore makes sense that any portable or consumer equipment (including Apple TV) use Objective C as their primary development language, and dropping down to the underlying C layer when needed for performance or interface issues.

提交回复
热议问题