nskeyedarchiver - How can an NSIndexSet be a root object? -
here typical code snippet when reordering table drag , drop.
- (bool)tableview:(nstableview *)tv writerowswithindexes:(nsindexset *)rowindexes topasteboard:(nspasteboard *)pboard { nsdata *data = [nskeyedarchiver archiveddatawithrootobject:rowindexes]; [pboard declaretypes:[nsarray arraywithobject:mydatatype] owner:self]; [pboard setdata:data fortype:mydatatype]; sourceindex = [rowindexes firstindex]; return yes; }
look @ line
nsdata *data = [nskeyedarchiver archiveddatawithrootobject:rowindexes];
how can rowindexes root object?
the docs nsindexset class represents immutable collection of unique unsigned integers.... use index sets in code store indexes other data structure. example, given nsarray object, use index set identify subset of objects in array.
it seems nsindexset not "an immutable collection of unique unsigned integers" set of pointers identify objects. it's confusing, can explain what's going on?
Comments
Post a Comment