I have:
- (void) observeValueForKeyPath:(NSString *)keyPath
ofObject:(Player *)object
change:(NSDictionary<NSString *,id> *)change
context:(void *)context
{
switch (object.Status)
{
case 0:
NSLog(@"%ld Play" ,object.Status);
break;
case 1:
NSLog(@"%ld Pause", object.Status);
break;
case 2:
NSLog(@"%ld Stop", object.Status);
break;
case 3:
NSLog(@"%ld RewindF", object.Status);
break;
case 4:
NSLog(@"%ld RewindB", object.Status);
break;
default:
break;
}
}
And:
[player addObserver:classA
forKeyPath:@"Status"
options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld
context:nil];
I want to see on screen 2 values:
NewValueKey
and OldValueKey
but I don't how to NSLog OldValue too.
I tried sth that
NSString *oldValue = [change objectForKey:NSKeyValueObservingOptionNew];
But I got error
"NSUInteger too String"
How to connect old and new in one NSLog :)?