System.IsFunctionAvailable returns false

Consider this code:

    if System.IsFunctionAvailable( "backingScaleFactor", "AppKit" ) then
      soft declare function BackingScaleFactor lib "AppKit" selector "backingScaleFactor" (target As WindowPtr) as double
      // Introduced in MacOS X 10.7.
      r = BackingScaleFactor(w)
    end if

The declare itself works, but IsFunctionAvailable returns false. Why?

IsFunctionAvailable does not work with selectors.

Is there a way to write it that would work?

Nope. you would need to use a declare a call to respondsToSelector.