title: What are the semantics of using retain vs. copy for a property of type NSMutableSet;
body: <p>I have been using the most excellent Accessorizer to auto-magically generate setters/getters for my Obj-C code in Xcode. Recently a change was made in Accessorizer:</p>
  
  <p>old version of Accessorizer:<br>
  @property (nonatomic, retain) NSMutableSet *setA;<br>
  @property (nonatomic, retain) NSMutableSet *setB;  </p>
  
  <p>new version of Accessorizer:<br>
  @property (nonatomic, copy) NSMutableSet *setA;<br>
  @property (nonatomic, copy) NSMutableSet *setB;  </p>
  
  <p>Sadly, the new version crashes my code. In my code I do the following:</p>
  
  <pre><code>self.setA = [[[NSMutableSet alloc] init] autorelease];
  self.setB = [[[NSMutableSet alloc] init] autorelease];
  </code></pre>
  
  <p>// ...</p>
  
  <pre><code>[self.setA minusSet:self.setB];  
  </code></pre>
  
  <p>The above line of code works fine using the old way (retain) but crashes using the new way (copy). Clearly something is wrong here. I rely on Accessorizer extensively. Could someone please clarify the implications of using copy/retain in the context of NSMutableSet? </p>
  
  <p>Thanks,<br>
  Doug</p>