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;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self.outlineView setDelegate:nil];
}
- (void)didLoadView {
[_outlineView setDelegate:self];
[_outlineView setMenu:[self _contextMenu]];
[_outlineView setAllowsEmptySelection:YES];
[_outlineView setFloatsGroupRows:NO];
[_outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]];
[_outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[_bottomBar setBorderType:HNHBorderTop|HNHBorderHighlight];
[_addGroupButton setAction:[MPActionHelper actionOfType:MPActionAddGroup]];
[self.outlineView setDelegate:self];
[self.outlineView setMenu:[self _contextMenu]];
[self.outlineView setAllowsEmptySelection:YES];
[self.outlineView setFloatsGroupRows:NO];
[self.outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]];
[self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[self.bottomBar setBorderType:HNHBorderTop|HNHBorderHighlight];
[self.addGroupButton setAction:[MPActionHelper actionOfType:MPActionAddGroup]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didBecomeFirstResponder:)
name:MPDidActivateViewNotification
object:_outlineView];
object:self.outlineView];
}