title: Core Data: best way of checking the uniqueness of an attribute
body: <p>As far as I know, there is no way of setting an entity's attribute as unique through <code>Core Data</code>, neither programmatically nor in Xcode's editor... I need to make sure that certain managed objects can't be created if there are collisions with the values of the attributes I want to be unique, and I've been reading some posts dealing with that.</p>
  
  <p>I've found a couple of approaches (e.g. <a href="https://stackoverflow.com/questions/2239797/core-data-unique-attributes">Core Data unique attributes</a>): </p>
  
  <ol>
  <li>To use <code>-validateValue:forKey:error:</code></li>
  <li>To write some kind of custom method to check if the attribute's value already exists</li>
  </ol>
  
  <p>What should the most recommendable option be?</p>
  
  <p>Thanks</p>