Home › Forums › Syphon › Syphon Development – Developer › how do i correlate a KVO with a particular object? › Reply To: how do i correlate a KVO with a particular object?
If you register to receive notifications before the change as well as after (using the NSKeyValueObservingOptionPrior option), the change dictionary should contain the index of the item which will be be removed (for removals) – and at that point .servers will still contain the about-to-go server. For additions and name-changes, the change dictionary after the change should have the index of the changed item(s).
That said, depending what you’re doing, it might be easier to register for SyphonServerDirectory’s NSNotifications (SyphonServerAnnounceNotification, SyphonServerUpdateNotification and SyphonServerRetireNotification) and not use KVO at all, as the notifications pass you the serverDescription for the changing server as their notification object.