Why does Apple use Objective-C?

前端 未结 4 1134
花落未央
花落未央 2021-02-11 16:50

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.

4条回答
  •  孤独总比滥情好
    2021-02-11 17:06

    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.

提交回复
热议问题