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

@@ -60,9 +60,9 @@ typedef NS_ENUM(NSUInteger, MPDatePreset) {
- (IBAction)useDate:(id)sender {
KPKTimeInfo *timeInfo = [self.representedObject timeInfo];
[self willChangeValueForRepresentedObjectKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expirationDate))]];
[self.windowController.document willChangeModelProperty];
timeInfo.expirationDate = self.datePicker.dateValue;
[self didChangeValueForRepresentedObjectKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expirationDate))]];
[self.windowController.document didChangeModelProperty];
[self.view.window performClose:sender];
}