Using simpler aproach for modelChange proadcasting by using the document as broadcaster

This commit is contained in:
michael starke
2016-08-30 12:59:27 +02:00
parent da295b9acd
commit 8b60e9ec84
13 changed files with 74 additions and 269 deletions

View File

@@ -7,16 +7,19 @@
//
#import "MPCustomFieldTableCellView.h"
#import "MPDocument.h"
@implementation MPCustomFieldTableCellView
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
[super setBackgroundStyle:NSBackgroundStyleLight];
super.backgroundStyle = NSBackgroundStyleLight;
}
- (void)setValue:(id)value forKeyPath:(NSString *)keyPath {
NSLog(@"%@ setValue:forKeyPath:%@", NSStringFromClass([self class]), keyPath);
if([keyPath hasPrefix:@"objectValue."]) {
[self.window.windowController.document willChangeModelProperty];
[super setValue:value forKeyPath:keyPath];
[self.window.windowController.document didChangeModelProperty];
}
[super setValue:value forKeyPath:keyPath];
}
@end