title: Key-Value Observing an NSMutableSet
body: <p>In a plain class I have a NSMutableSet property. Whenever objects are added to or removed from the set, I want to perform some custom code. I know I could write a few <code>addObjectToSet:</code>-like methods to the class, but I was wondering if there's a more elegant solution with direct KVO on the set.</p>
  
  <p>As it turns out, NSSet will raise an exception when you try to add an observer to it. Not surprisingly, for there's probably no named keyPath to observe. <a href="http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSSet_Class/Reference/Reference.html#//apple_ref/occ/instm/NSSet/addObserver%3aforKeyPath%3aoptions%3acontext%3a">The documentation</a> is pretty clear about the exception, but I don't understand the suggested workaround:</p>
  
  <blockquote>
    <p>Instead of observing a set, observe the unordered to-many relationship for which the set is the collection of related objects.</p>
  </blockquote>
  
  <p>Could someone reiterate what this means? And what a workaround would then look like?</p>