diff options
| author | Tomáš Znamenáček | 2014-08-07 14:04:32 +0200 |
|---|---|---|
| committer | Tomáš Znamenáček | 2015-01-07 15:42:22 +0100 |
| commit | 6128e529ea5c0d09de65dcbbc00a299f6b871735 (patch) | |
| tree | 319c8bd2a99055a6185c3c742fb1caa9531cecd9 /Framework/MASShortcutView.m | |
| parent | 80808eb6d7590dc2f4ed0bd3f5873c7472010a7b (diff) | |
| download | MASShortcut-6128e529ea5c0d09de65dcbbc00a299f6b871735.tar.bz2 | |
Whitespace fixes.
Diffstat (limited to 'Framework/MASShortcutView.m')
| -rw-r--r-- | Framework/MASShortcutView.m | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 61df2d0..716edba 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -462,46 +462,46 @@ void *kUserDataHint = &kUserDataHint; // http://tomdalling.com/blog/cocoa/implementing-your-own-cocoa-bindings/ -(void) propagateValue:(id)value forBinding:(NSString*)binding; { - NSParameterAssert(binding != nil); - - //WARNING: bindingInfo contains NSNull, so it must be accounted for - NSDictionary* bindingInfo = [self infoForBinding:binding]; - if(!bindingInfo) - return; //there is no binding - - //apply the value transformer, if one has been set - NSDictionary* bindingOptions = [bindingInfo objectForKey:NSOptionsKey]; - if(bindingOptions){ - NSValueTransformer* transformer = [bindingOptions valueForKey:NSValueTransformerBindingOption]; - if(!transformer || (id)transformer == [NSNull null]){ - NSString* transformerName = [bindingOptions valueForKey:NSValueTransformerNameBindingOption]; - if(transformerName && (id)transformerName != [NSNull null]){ - transformer = [NSValueTransformer valueTransformerForName:transformerName]; - } - } - - if(transformer && (id)transformer != [NSNull null]){ - if([[transformer class] allowsReverseTransformation]){ - value = [transformer reverseTransformedValue:value]; - } else { - NSLog(@"WARNING: binding \"%@\" has value transformer, but it doesn't allow reverse transformations in %s", binding, __PRETTY_FUNCTION__); - } - } - } - - id boundObject = [bindingInfo objectForKey:NSObservedObjectKey]; - if(!boundObject || boundObject == [NSNull null]){ - NSLog(@"ERROR: NSObservedObjectKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); - return; - } - - NSString* boundKeyPath = [bindingInfo objectForKey:NSObservedKeyPathKey]; - if(!boundKeyPath || (id)boundKeyPath == [NSNull null]){ - NSLog(@"ERROR: NSObservedKeyPathKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); - return; - } - - [boundObject setValue:value forKeyPath:boundKeyPath]; + NSParameterAssert(binding != nil); + + //WARNING: bindingInfo contains NSNull, so it must be accounted for + NSDictionary* bindingInfo = [self infoForBinding:binding]; + if(!bindingInfo) + return; //there is no binding + + //apply the value transformer, if one has been set + NSDictionary* bindingOptions = [bindingInfo objectForKey:NSOptionsKey]; + if(bindingOptions){ + NSValueTransformer* transformer = [bindingOptions valueForKey:NSValueTransformerBindingOption]; + if(!transformer || (id)transformer == [NSNull null]){ + NSString* transformerName = [bindingOptions valueForKey:NSValueTransformerNameBindingOption]; + if(transformerName && (id)transformerName != [NSNull null]){ + transformer = [NSValueTransformer valueTransformerForName:transformerName]; + } + } + + if(transformer && (id)transformer != [NSNull null]){ + if([[transformer class] allowsReverseTransformation]){ + value = [transformer reverseTransformedValue:value]; + } else { + NSLog(@"WARNING: binding \"%@\" has value transformer, but it doesn't allow reverse transformations in %s", binding, __PRETTY_FUNCTION__); + } + } + } + + id boundObject = [bindingInfo objectForKey:NSObservedObjectKey]; + if(!boundObject || boundObject == [NSNull null]){ + NSLog(@"ERROR: NSObservedObjectKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); + return; + } + + NSString* boundKeyPath = [bindingInfo objectForKey:NSObservedKeyPathKey]; + if(!boundKeyPath || (id)boundKeyPath == [NSNull null]){ + NSLog(@"ERROR: NSObservedKeyPathKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); + return; + } + + [boundObject setValue:value forKeyPath:boundKeyPath]; } @end |
