cocoa - Exception thrown in NSOrderedSet generated accessors -
on lion app, have data model:
the relationship subitems
inside item
is ordered.
xcode 4.1 (build 4b110) has created me file item.h
, item.m
, subitem.h
, subitem.h
.
here content (autogenerated) of item.h
:
#import <foundation/foundation.h> #import <coredata/coredata.h> @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
and here content (autogenerated) of item.m
:
#import "item.h" #import "subitem.h" @implementation item @dynamic name; @dynamic subitems; @end
as can see, class item
offers method called addsubitemsobject:
. unfortunately, when trying use in way:
item *item = [nsentitydescription insertnewobjectforentityforname:@"item" inmanagedobjectcontext:self.managedobjectcontext]; item.name = @"firstitem"; subitem *subitem = [nsentitydescription insertnewobjectforentityforname:@"subitem" inmanagedobjectcontext:self.managedobjectcontext]; [item addsubitemsobject:subitem];
this error appear:
2011-09-12 10:28:45.236 test[2002:707] *** -[nsset intersectsset:]: set argument not nsset
can me?
update:
after 1,787 days bug report, today (august 1, 2016) apple wrote me this: "please verify issue latest ios 10 beta build , update bug report @ bugreport.apple.com results.". let's hope right time :)
i reproduced setup both data model , 1 of own different names. got same error in both cases.
looks bug in apple's autogenerated code.
Comments
Post a Comment