mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 01:02:24 +00:00
model updates via binding thourh mpviewcontroller now get registered
This commit is contained in:
@@ -38,4 +38,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Binding observation
|
||||
- (void)setValue:(id)value forKeyPath:(NSString *)keyPath {
|
||||
if([keyPath hasPrefix:@"representedObject."]) {
|
||||
[self didChangeValueForRepresentedObjectKeyPath:keyPath];
|
||||
[super setValue:value forKeyPath:keyPath];
|
||||
[self didChangeValueForRepresentedObjectKeyPath:keyPath];
|
||||
}
|
||||
else {
|
||||
[super setValue:value forKeyPath:keyPath];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)willChangeValueForRepresentedObjectKeyPath:(NSString *)keyPath {
|
||||
NSLog(@"[%@ willChangeValueForRepresentedObjectKeyPath:%@]", NSStringFromClass([self class]), keyPath);
|
||||
}
|
||||
|
||||
- (void)didChangeValueForRepresentedObjectKeyPath:(NSString *)keyPath {
|
||||
NSLog(@"[%@ didChangeValueForRepresentedObjectKeyPath:%@]", NSStringFromClass([self class]), keyPath);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user