Created
November 16, 2008 09:31
-
-
Save nickjs/25441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation LEPresentation : CPDictionary | |
- (void)setValue:(id)aValue forUndefinedKey:(CPString)keyPath | |
{ | |
[self setObject:aValue forKey:keyPath]; | |
} | |
- (void)mapToView:(CPView)aView | |
{ | |
for(var i = 0; i < [[self allKeys] count]; i++) | |
{ | |
var key = [self allKeys][i]; | |
if([aView respondsToSelector:key]) | |
{ | |
[aView setValue:[self objectForKey:key] forKey:key]; | |
[self addObserver:self forKeyPath:key options:CPKeyValueObservingOptionNew context:aView]; | |
} | |
} | |
} | |
- (void)observeValueForKeyPath:(CPString)key ofObject:(id)object change:(CPDictionary)change context:(id)aView | |
{ | |
if(aView) | |
if([aView respondsToSelector:key]) | |
[aView setValue:[self objectForKey:key] forKey:key]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment