From 06c5f4d740b02aa355a00a072b4292a92871a9c4 Mon Sep 17 00:00:00 2001 From: michael starke Date: Thu, 25 Feb 2016 15:48:07 +0100 Subject: [PATCH] using explicit setters instead of bindings for selection --- MacPass/MPInspectorViewController.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 0a0ef0bf..7625d6a6 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -104,12 +104,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { [self.view layout]; - /* Init edit and cancel buttons */ - self.editButton.action = @selector(beginEditing:); - self.cancelEditButton.action = @selector(cancelEditing:); self.cancelEditButton.hidden = YES; - [self _toggleEditors:NO]; + [self _establishBindings]; } - (void)registerNotificationsForDocument:(MPDocument *)document { @@ -119,10 +116,6 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { object:document]; [self.entryViewController registerNotificationsForDocument:document]; - - [self.nodeController bind:NSContentBinding toObject:document withKeyPath:NSStringFromSelector(@selector(selectedItem)) options:nil]; - [self _establishBindings]; - [self.entryViewController setupBindings:document]; [self.groupViewController setupBindings:document]; } @@ -284,8 +277,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { else { self.activeTab = MPEmptyTab; } - - [self _establishBindings]; + self.nodeController.content = document.selectedItem; + self.entryViewController.representedObject = document.selectedItem.asEntry; + self.groupViewController.representedObject = document.selectedItem.asGroup; } - (IBAction)beginEditing:(id)sender {