Zet - What does NS prefix mean in macOS/iOS development?

What does NS prefix mean in macOS/iOS development?

In Objective-C, many classes, especially those provided by the Foundation framework, start with “NS” because it stands for NeXTSTEP. This is a nod to the origins of the language and the framework itself:

  1. Historical Context: NeXTSTEP was an operating system developed by NeXT, the company founded by Steve Jobs after he left Apple in the 1980s. Objective-C was the primary programming language used for NeXTSTEP.

  2. Prefix Usage: To avoid naming conflicts and ensure that class names are unique, Apple adopted the “NS” prefix (short for NeXTSTEP). For example, NSString, NSArray, and NSDictionary are all part of the Foundation framework.

  3. Continued Tradition: Even after NeXT was acquired by Apple and NeXTSTEP evolved into macOS, the convention of using “NS” for class names in the Foundation framework persisted.

This naming convention helps maintain a clear and consistent naming scheme throughout the iOS and macOS development ecosystems.

#ios #objectiveC