Closed synapse closed 10 years ago
Hello, I saw this behavior with development builds, maybe it does not depend on MASShortcut? Seems more like a bug with OS X sandboxing to me. Could you please confirm that things start working once you remove the component? Sorry for the late reply.
Hello, I removed the sandbox and it still does not save the keys in my pref file. Could you indicate which is the method that saves the user defaults with the NSData after the keys were assigned? Till now I've added around 20 NSLogs and nothing seams to fire after this method
MASShortcut
saves NSData
into User Defaults here: MASShortcutView+UserDefaults.m:120
. Does it help?
You have assigned the associatedUserDefaultsKey
and MASShortcutDefaultsObserver
has been created, right?
I've followed your demo project and assigned the "associatedUserDefaultsKey" to the view and set up a "MASShortcut registerGlobalShortcutWithUserDefaultsKey" that listens for the hotkey action. As for the "MASShortcutDefaultsObserver" I could't find any usage examples.
MASShortcutDefaultsObserver
is under the hood detail, there is no need to create it. But could you set a breakpoint in its -init
method. Does it get called?
Nope, doesn't get called. Here are some attached images http://cl.ly/VIB8 and http://cl.ly/VHpD . From the README I understand this should be enough to make it run.
Does setAssociatedUserDefaultsKey:
get called? Please ensure than IBOutlet
s are connected.
Ok found the problem. I had a typo in my code (that's what you get when you let your children touch your pc). It's 2 days I'm trying to figure out why it doesn't hook. Thank you for your help and sorry for wasting your time.
BTW thanks a lot for this tool. Bye
No problem, glad you fixed it :) Have a good day!
Hello, I noticed that on 10.9 the preference is not saved. Actually the .plist file is not created. In one of my other sandboxed project I managed to create the prefs .plist file by calling the [NSUserDefaults resetStandardUserDefaults]; before setting the pref object and syncing.
Any ideas how to fix this? Thanks in advance
Cris.