diff options
| -rw-r--r-- | Framework/MASShortcutBinder.h | 1 | ||||
| -rw-r--r-- | Framework/MASShortcutBinder.m | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Framework/MASShortcutBinder.h b/Framework/MASShortcutBinder.h index 74842f3..3cd54dd 100644 --- a/Framework/MASShortcutBinder.h +++ b/Framework/MASShortcutBinder.h @@ -3,6 +3,7 @@ @interface MASShortcutBinder : NSObject @property(strong) MASShortcutMonitor *shortcutMonitor; +@property(copy) NSDictionary *bindingOptions; - (void) bindShortcutWithDefaultsKey: (NSString*) defaultsKeyName toAction: (dispatch_block_t) action; - (void) breakBindingWithDefaultsKey: (NSString*) defaultsKeyName; diff --git a/Framework/MASShortcutBinder.m b/Framework/MASShortcutBinder.m index 0de99db..2b30157 100644 --- a/Framework/MASShortcutBinder.m +++ b/Framework/MASShortcutBinder.m @@ -16,6 +16,7 @@ [self setActions:[NSMutableDictionary dictionary]]; [self setShortcuts:[NSMutableDictionary dictionary]]; [self setShortcutMonitor:[MASShortcutMonitor sharedMonitor]]; + [self setBindingOptions:@{NSValueTransformerNameBindingOption: NSKeyedUnarchiveFromDataTransformerName}]; return self; } @@ -31,9 +32,8 @@ - (void) bindShortcutWithDefaultsKey: (NSString*) defaultsKeyName toAction: (dispatch_block_t) action { [_actions setObject:[action copy] forKey:defaultsKeyName]; - NSDictionary *bindingOptions = @{NSValueTransformerNameBindingOption: NSKeyedUnarchiveFromDataTransformerName}; [self bind:defaultsKeyName toObject:[NSUserDefaultsController sharedUserDefaultsController] - withKeyPath:[@"values." stringByAppendingString:defaultsKeyName] options:bindingOptions]; + withKeyPath:[@"values." stringByAppendingString:defaultsKeyName] options:_bindingOptions]; } - (void) breakBindingWithDefaultsKey: (NSString*) defaultsKeyName |
