title: Exception thrown in NSOrderedSet generated accessors
body: <p>On my Lion app, I have this data model:</p>
  
  <p><img src="https://i.stack.imgur.com/CYI00.png" alt="enter image description here"></p>
  
  <p>The relationship <code>subitems</code> inside <code>Item</code> <strong>is ordered</strong>.</p>
  
  <p>Xcode 4.1 (build 4B110) has created for me the file <code>Item.h</code>, <code>Item.m</code>, <code>SubItem.h</code> and <code>SubItem.h</code>.</p>
  
  <p>Here is the content (autogenerated) of <code>Item.h</code>:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  #import &lt;CoreData/CoreData.h&gt;
  
  @class SubItem;
  
  @interface Item : NSManagedObject {
  @private
  }
  
  @property (nonatomic, retain) NSString * name;
  @property (nonatomic, retain) NSOrderedSet *subitems;
  @end
  
  @interface Item (CoreDataGeneratedAccessors)
  
  - (void)insertObject:(SubItem *)value inSubitemsAtIndex:(NSUInteger)idx;
  - (void)removeObjectFromSubitemsAtIndex:(NSUInteger)idx;
  - (void)insertSubitems:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
  - (void)removeSubitemsAtIndexes:(NSIndexSet *)indexes;
  - (void)replaceObjectInSubitemsAtIndex:(NSUInteger)idx withObject:(SubItem *)value;
  - (void)replaceSubitemsAtIndexes:(NSIndexSet *)indexes withSubitems:(NSArray *)values;
  - (void)addSubitemsObject:(SubItem *)value;
  - (void)removeSubitemsObject:(SubItem *)value;
  - (void)addSubitems:(NSOrderedSet *)values;
  - (void)removeSubitems:(NSOrderedSet *)values;
  
  @end
  </code></pre>
  
  <p>And here is the content (autogenerated) of <code>Item.m</code>:</p>
  
  <pre><code>#import "Item.h"
  #import "SubItem.h"
  
  @implementation Item
  
  @dynamic name;
  @dynamic subitems;
  
  @end
  </code></pre>
  
  <p>As you can see, the class <code>Item</code> offers a method called <code>addSubitemsObject:</code>. Unfortunately, when trying to use it in this way:</p>
  
  <pre><code>Item *item = [NSEntityDescription insertNewObjectForEntityForName:@"Item" inManagedObjectContext:self.managedObjectContext];
  item.name = @"FirstItem";
  
  SubItem *subItem = [NSEntityDescription insertNewObjectForEntityForName:@"SubItem" inManagedObjectContext:self.managedObjectContext];
  
  [item addSubitemsObject:subItem];
  </code></pre>
  
  <p>this error appear:</p>
  
  <pre><code>2011-09-12 10:28:45.236 Test[2002:707] *** -[NSSet intersectsSet:]: set argument is not an NSSet
  </code></pre>
  
  <p>Can you help me?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>After just 1,787 days from my bug report, today (August 1, 2016) Apple wrote me this: <em>"Please verify this issue with the latest iOS 10 beta build and update your bug report at bugreport.apple.com with your results."</em>. Let's hope this is the right time :)</p>