Created
April 15, 2013 06:53
-
-
Save tempos21ios/5386204 to your computer and use it in GitHub Desktop.
Ejemplo KVO
This file contains hidden or 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
//Vamos a observar la propiedad cartUnits del objeto _product | |
[_product addObserver:self forKeyPath:@"cartUnits" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil]; | |
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context | |
{ | |
if([keyPath isEqualToString:@"cartUnits"]) | |
{ | |
//Acción | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment