scripting-bridge

What is the type of an enum whose values appear to be strings?

こ雲淡風輕ζ 提交于 2019-11-30 13:49:50
问题 I am working with Apple's ScriptingBridge framework, and have generated a header file for iTunes that contains several enum s like this: typedef enum { iTunesESrcLibrary = 'kLib', iTunesESrcIPod = 'kPod', iTunesESrcAudioCD = 'kACD', iTunesESrcMP3CD = 'kMCD', iTunesESrcDevice = 'kDev', iTunesESrcRadioTuner = 'kTun', iTunesESrcSharedLibrary = 'kShd', iTunesESrcUnknown = 'kUnk' } iTunesESrc; My understanding was that enum values had to be integer-like, but this definition seems to violate that

What is the type of an enum whose values appear to be strings?

戏子无情 提交于 2019-11-30 08:35:23
I am working with Apple's ScriptingBridge framework, and have generated a header file for iTunes that contains several enum s like this: typedef enum { iTunesESrcLibrary = 'kLib', iTunesESrcIPod = 'kPod', iTunesESrcAudioCD = 'kACD', iTunesESrcMP3CD = 'kMCD', iTunesESrcDevice = 'kDev', iTunesESrcRadioTuner = 'kTun', iTunesESrcSharedLibrary = 'kShd', iTunesESrcUnknown = 'kUnk' } iTunesESrc; My understanding was that enum values had to be integer-like, but this definition seems to violate that rule. Furthermore, it seems as though treating these enum values as integers (in an NSPredicate , for

Objective-C Mac OS X Distributed notifications iTunes

本秂侑毒 提交于 2019-11-27 20:19:36
i need a little help, i currently have a method; updateTrackInfo in my Mac OS X application which gets the artist name, the track name and duration of the track currently being played in iTunes However i want the app to listen for the distributed iTunes notification; com.apple.iTunes.playerInfo then call the method updateTrackInfo when ever the notification is distributed by iTunes. Please could someone help me, on what i would need to write in both the header and implementation file. Thanks, Sami. You're looking for -[NSDistributedNotificationCenter addObserver:selector:name:object:] :

Objective-C Mac OS X Distributed notifications iTunes

白昼怎懂夜的黑 提交于 2019-11-26 22:56:29
问题 i need a little help, i currently have a method; updateTrackInfo in my Mac OS X application which gets the artist name, the track name and duration of the track currently being played in iTunes However i want the app to listen for the distributed iTunes notification; com.apple.iTunes.playerInfo then call the method updateTrackInfo when ever the notification is distributed by iTunes. Please could someone help me, on what i would need to write in both the header and implementation file. Thanks,