bubbling NSEditorRegistration calls from NSViewController up to NSDocument

This commit is contained in:
michael starke
2016-10-17 18:17:52 +02:00
parent d9f74938d0
commit 9ac7c93fbf
3 changed files with 20 additions and 1 deletions

View File

@@ -10,6 +10,15 @@
#import "MPDocument.h"
@implementation MPCustomFieldTableCellView
- (void)objectDidBeginEditing:(id)editor {
[self.window.windowController.document objectDidBeginEditing:editor];
}
- (void)objectDidEndEditing:(id)editor {
[self.window.windowController.document objectDidEndEditing:editor];
}
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
super.backgroundStyle = NSBackgroundStyleLight;
}

View File

@@ -821,5 +821,4 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidChangeModelPropertyNotification object:self];
}
@end

View File

@@ -38,6 +38,17 @@
}
}
#pragma mark NSEditorRegistration
- (void)objectDidBeginEditing:(id)editor {
[self.windowController.document objectDidBeginEditing:editor];
[super objectDidBeginEditing:editor];
}
- (void)objectDidEndEditing:(id)editor {
[self.windowController.document objectDidEndEditing:editor];
[super objectDidEndEditing:editor];
}
#pragma mark Binding observation
- (void)setValue:(id)value forKeyPath:(NSString *)keyPath {
if([keyPath hasPrefix:@"representedObject."]) {