From 5e20a6d9efe74605adf5fc4d6a64813f4be992ee Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Sun, 22 Aug 2010 11:40:26 -0400 Subject: [PATCH] Sending NS_initWithCoder at the right time --- Tools/nib2cib/NSButton.j | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Tools/nib2cib/NSButton.j b/Tools/nib2cib/NSButton.j index a9adfb9c1..ecd9dc5d6 100644 --- a/Tools/nib2cib/NSButton.j +++ b/Tools/nib2cib/NSButton.j @@ -165,7 +165,8 @@ _CPButtonBezelStyleHeights[CPHUDBezelStyle] = 20; - (id)initWithCoder:(CPCoder)aCoder { - // We need to do a bit of magic to determine if this is a checkbox or radio button. + // We need to do a bit of magic to determine if this is a checkbox or radio button + // BEFORE we can initialize the rest of the object. var cell = [aCoder decodeObjectForKey:@"NSCell"], alternateImage = [cell alternateImage]; @@ -181,10 +182,12 @@ _CPButtonBezelStyleHeights[CPHUDBezelStyle] = 20; } } - [self setKeyEquivalent:[cell keyEquivalent]]; - [self setKeyEquivalentModifierMask:[cell keyEquivalentModifierMask]]; + var self = [self NS_initWithCoder:aCoder]; - return [self NS_initWithCoder:aCoder]; + [self setKeyEquivalent:[cell keyEquivalent]]; + _keyEquivalentModifierMask = [cell keyEquivalentModifierMask]; + + return self; } - (Class)classForKeyedArchiver