• 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
Building for earlier OS X versions : Check for NULL *address* of constants
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building for earlier OS X versions : Check for NULL *address* of constants


  • Subject: Building for earlier OS X versions : Check for NULL *address* of constants
  • From: Jerry Krinock <email@hidden>
  • Date: Sun, 28 Apr 2013 18:59:16 -0700

In Apple's SDK Compatibility Guide > Using SDK-Based Development, it says…

"Check the availability of an external (extern) constant or a notification name by explicitly comparing its address — and not the symbol’s bare name — to NULL or nil."

It also says, regarding C *functions* that "the linker sets the address of unavailable functions to NULL".  Do they mean during the linking phase of building, or when the program loads (runtime)?

More importantly, is the following code correct?  It looks weird.

NSString* identifier ;
if (&NSWorkspaceApplicationKey != NULL) {
    // We are running in Mac OS X 10.6 or later
    identifier = <expression using the bare name: NSWorkspaceApplicationKey> ;
}
else {
    // We are running in Mac OS X 10.5
    identifier = <some other expression> ;
}

Thanks,

Jerry Krinock
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Building for earlier OS X versions : Check for NULL *address* of constants
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Re: Can I sort files in compile sources of Build Phases?
  • Next by Date: Re: Building for earlier OS X versions : Check for NULL *address* of constants
  • Previous by thread: Re: Can I sort files in compile sources of Build Phases?
  • Next by thread: Re: Building for earlier OS X versions : Check for NULL *address* of constants
  • Index(es):
    • Date
    • Thread