What does the NS prefix mean?

前端 未结 9 1054
别跟我提以往
别跟我提以往 2020-12-02 03:32

Many classes in Cocoa/Cocoa Touch have the NS prefix. What does it mean?

9条回答
  •  一向
    一向 (楼主)
    2020-12-02 04:05

    From Cocoa_(API) Wikipedia:

    (emphasis added)

    Cocoa classes begin with the acronym "NS" (standing either for the NeXT-Sun creation of OpenStep, or for the original proprietary term for the OpenStep framework, NeXTSTEP): NSString, NSArray, etc.

    Foundation Kit, or more commonly simply Foundation, first appeared in OpenStep. On Mac OS X, it is based on Core Foundation. Foundation is a generic object-oriented library providing string and value manipulation, containers and iteration, distributed computing, run loops, and other functions that are not directly tied to the graphical user interface. The "NS" prefix, used for all classes and constants in the framework, comes from Cocoa's OPENSTEP heritage, which was jointly developed by NeXT and Sun.

提交回复
热议问题