Guest User

Untitled

a guest
Apr 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. [self addObserver:self forKeyPath:@"age" options:NSKeyValueObservingOptionNew context:nil];
  2.  
  3. - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
  4. NSLog(@"keyPath->%@",keyPath);
  5. sleep(3);
  6.  
  7. self.age = @"12312";
  8. NSLog(@"postEnd");
  9.  
  10. keyPath->age
  11. //after 3 seconds
  12. postEnd
Add Comment
Please, Sign In to add comment