I have a single customer who’s getting an Objective-C exception when the application executes code similar to the below. The exception is that NSCFString doesn’t respond to the “description” message.
Would you mind helping me, by putting this code in the window.open event of a new project, then running the project on OS X 10.11.4 (32-Bit).
[code] #if TargetMacOS then
declare function SCDynamicStoreCopyComputerName lib “SystemConfiguration” ( store as Ptr, encoding as Ptr ) as Ptr
declare function description lib “Cocoa” selector “description” ( ID as Ptr ) as CFStringRef
declare sub CFRelease lib “Cocoa” ( ID as Ptr )
Dim ref as Ptr = SCDynamicStoreCopyComputerName( nil, nil ) self.title = description( ref ) CFRelease ref
The code has been working fine on our test machines, running 10.7.x all the way through 10.11.4 so I’m a bit surprised, but not completely. If the code works, it’ll set the title of the Window to the name of the machine, if it fails you’ll get an Objective-C exception.
Thanks for helping me out here.