mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-28 06:20:24 +00:00
Andy Balholm's NSCachingBinder changes
This commit is contained in:
parent
f5748d47d1
commit
9cf7fc36f2
@ -16,6 +16,7 @@
|
||||
{
|
||||
id _cachedValue;
|
||||
BOOL _bound;
|
||||
BOOL _currentlyTransferring;
|
||||
}
|
||||
|
||||
- (id)cachedValue;
|
||||
|
@ -55,8 +55,9 @@ static void * NSCachingBinderChangeContext = (void *)@"NSCachingBinderChangeCont
|
||||
|
||||
- (void)showValue:(id)newValue
|
||||
{
|
||||
if (![_cachedValue isEqual:newValue])
|
||||
if (![_cachedValue isEqual:newValue] && !_currentlyTransferring)
|
||||
{
|
||||
_currentlyTransferring = YES;
|
||||
[self setCachedValue:newValue];
|
||||
|
||||
BOOL editable=YES;
|
||||
@ -90,15 +91,19 @@ static void * NSCachingBinderChangeContext = (void *)@"NSCachingBinderChangeCont
|
||||
|
||||
if(isPlaceholder && [_source respondsToSelector:@selector(_setCurrentValueIsPlaceholder:)])
|
||||
[_source _setCurrentValueIsPlaceholder:YES];
|
||||
|
||||
_currentlyTransferring = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applyValue:(id)newValue
|
||||
{
|
||||
if (![_cachedValue isEqual:newValue])
|
||||
if (![_cachedValue isEqual:newValue] && !_currentlyTransferring)
|
||||
{
|
||||
_currentlyTransferring = YES;
|
||||
[self setCachedValue:newValue];
|
||||
[_destination setValue:newValue forKeyPath:_keyPath];
|
||||
_currentlyTransferring = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user