title: NSTokenField and deleting tokens
body: <p>My app allows users to attach tags to certain model objects (subclasses of NSManagedObject). The Tag class is also a subclass of NSManagedObject. I decided to use <code>NSTokenField</code> to display the tags, where each token holds an instance of Tag as the represented object. It all works pretty good but I'm stuck in situations where the user deletes a token as I want to check whether the associated Tag has become obsolete and should be deleted.</p>
  
  <p>I was expecting a method in <code>NSTokenFieldDelegate</code> or <code>NSTokenFieldCellDelegate</code> which would allow me to intercept and check a delete action on a token.</p>
  
  <p>After some googling I found <a href="http://subjectiveobserver.wordpress.com/2011/03/14/more-than-token-problems/" rel="nofollow noreferrer">this post</a> addressing the topic. I implemented the suggested method <code>controlTextDidChange:</code> in my controller (the delegate of the token field). Upon inspecting the control that is passed as an argument, it revealed to be an instance of <code>NSTokenTextView</code> for which I cannot find any documentation (probably a private class).</p>
  
  <p>Has anybody run into this and found a solution to gracefully delete tokens while maintaining the underlying model of represented objects?</p>
  
  <p>EDIT</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/4357624/callback-for-deleting-nstokenfieldcell">this</a> as well, which seems to suggest that for some reason it just is not designed to work like the rest of us would expect.</p>