Fixed possible crash issue with deallocated delegate

Fixed codestyle
This commit is contained in:
Michael Starke
2014-05-02 23:05:50 +02:00
parent 3482e256b2
commit 3ccff22f87

View File

@@ -66,21 +66,25 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
return self; return self;
} }
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self.outlineView setDelegate:nil];
}
- (void)didLoadView { - (void)didLoadView {
[_outlineView setDelegate:self]; [self.outlineView setDelegate:self];
[_outlineView setMenu:[self _contextMenu]]; [self.outlineView setMenu:[self _contextMenu]];
[_outlineView setAllowsEmptySelection:YES]; [self.outlineView setAllowsEmptySelection:YES];
[_outlineView setFloatsGroupRows:NO]; [self.outlineView setFloatsGroupRows:NO];
[_outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]]; [self.outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]];
[_outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES]; [self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[_bottomBar setBorderType:HNHBorderTop|HNHBorderHighlight]; [self.bottomBar setBorderType:HNHBorderTop|HNHBorderHighlight];
[_addGroupButton setAction:[MPActionHelper actionOfType:MPActionAddGroup]]; [self.addGroupButton setAction:[MPActionHelper actionOfType:MPActionAddGroup]];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didBecomeFirstResponder:) selector:@selector(_didBecomeFirstResponder:)
name:MPDidActivateViewNotification name:MPDidActivateViewNotification
object:_outlineView]; object:self.outlineView];
} }