• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NS Keywords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NS Keywords


  • Subject: Re: NS Keywords
  • From: Neil Faiman <email@hidden>
  • Date: Sat, 14 Jan 2017 14:19:33 -0500
  • X_cmae_category: , ,


On Jan 14, 2017, at 2:05 PM, debt <email@hidden> wrote:

What are all these NS keywords (?) that I keep seeing in people’s scripts? 

NSTimeZone’s
NSCalendar’s
NSCalendarUnitMonth
NSDate's


These scripts are using Apple’s Cocoa framework. Cocoa was originally an Objective C library. The Objective C language (like C, which it is based on) does not have any sort of namespace feature, so by convention, all global names in a library or framework are prefixed with a (hopefully) unique prefix of 2-4 upper case letters.

OS X was a direct descendant of NeXT Software’s NeXTSTEP operating system. Thus, the prefix for global names in the NeXTSTEP framework was NS. Cocoa was such a direct descendant of the NeXTSTEP framework that it still used the same names. Thus, the NS prefix for core OS framework class names in OS X.

Regards,

Neil Faiman
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: NS Keywords
      • From: debt <email@hidden>
References: 
 >NS Keywords (From: debt <email@hidden>)

  • Prev by Date: Re: set theAttachments to theMessage's mail attachments fails when called by a rule
  • Next by Date: Re: Calculate Current Year Quarter with Time Zone Using AppleScriptObjC
  • Previous by thread: NS Keywords
  • Next by thread: Re: NS Keywords
  • Index(es):
    • Date
    • Thread