diff --git a/MMTabBarView/MMTabBarView/MMTabBarView.m b/MMTabBarView/MMTabBarView/MMTabBarView.m index 25b3e8e8..dcfb2489 100644 --- a/MMTabBarView/MMTabBarView/MMTabBarView.m +++ b/MMTabBarView/MMTabBarView/MMTabBarView.m @@ -116,6 +116,9 @@ - (id)initWithFrame:(NSRect)frame { if (self) { // Initialization [self _commonInit]; + + _style = [[MMMetalTabStyle alloc] init]; + [self registerForDraggedTypes:[NSArray arrayWithObjects:AttachedTabBarButtonUTI, nil]]; // resize @@ -2125,6 +2128,10 @@ - (id)initWithCoder:(NSCoder *)aDecoder _automaticallyAnimates = [aDecoder decodeBoolForKey:@"MMautomaticallyAnimates"]; _alwaysShowActiveTab = [aDecoder decodeBoolForKey:@"MMalwaysShowActiveTab"]; } + + if (_style == nil) { + _style = [[MMMetalTabStyle alloc] init]; + } } return self; @@ -2274,7 +2281,7 @@ - (void)_commonInit { _buttonMaxWidth = 280; _buttonOptimumWidth = 130; _tearOffStyle = MMTabBarTearOffAlphaWindow; - _style = [[MMMetalTabStyle alloc] init]; + _style = nil; _isReorderingTabViewItems = NO; _destinationIndexForDraggedItem = NSNotFound; _needsUpdate = NO;