aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo F. Andrade2014-09-17 16:50:37 +0100
committerPaulo F. Andrade2014-09-17 16:50:37 +0100
commite53eed24bc6cc2856e732b16832730f6c2aa2827 (patch)
treea284a46c044c63864597f0f4f1db89a57da6eba0
parent724376092de61df8cb90b5b5d81ae0c30bcd1b24 (diff)
downloadMASShortcut-e53eed24bc6cc2856e732b16832730f6c2aa2827.tar.bz2
Implemented -initWithCoder: in MASShortcutView
-rw-r--r--MASShortcutView.m24
1 files changed, 19 insertions, 5 deletions
diff --git a/MASShortcutView.m b/MASShortcutView.m
index f4eb8ff..b2d2531 100644
--- a/MASShortcutView.m
+++ b/MASShortcutView.m
@@ -42,15 +42,29 @@
{
self = [super initWithFrame:frameRect];
if (self) {
- _shortcutCell = [[[self.class shortcutCellClass] alloc] init];
- _shortcutCell.buttonType = NSPushOnPushOffButton;
- _shortcutCell.font = [[NSFontManager sharedFontManager] convertFont:_shortcutCell.font toSize:BUTTON_FONT_SIZE];
- _enabled = YES;
- [self resetShortcutCellStyle];
+ [self commonInit];
+ }
+ return self;
+}
+
+- (id)initWithCoder:(NSCoder *)coder
+{
+ self = [super initWithCoder:coder];
+ if (self) {
+ [self commonInit];
}
return self;
}
+- (void)commonInit
+{
+ _shortcutCell = [[[self.class shortcutCellClass] alloc] init];
+ _shortcutCell.buttonType = NSPushOnPushOffButton;
+ _shortcutCell.font = [[NSFontManager sharedFontManager] convertFont:_shortcutCell.font toSize:BUTTON_FONT_SIZE];
+ _enabled = YES;
+ [self resetShortcutCellStyle];
+}
+
- (void)dealloc
{
[self activateEventMonitoring:NO];