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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -