Hey all. I've been working on a master-detail interface and I'm implementing dragging. FIrst off, a UI question: in a table with 5 rows, when I click the fifth row and begin dragging, the last selected item remains selected through the drag. Is this normal?
The reason I ask is that the errors I get seem to happen only when a row that was not selected is dragged and dropped somewhere within the table. If I first click on the row to select it, then drag and drop it somewhere else in the table, all works well. But when I drag a row/rows when there is another selection, I get this error:
2005-06-10 07:21:50.867 CCLS Route[1405] Error setting value for key path selectionIndexes of object <NSArrayController: 0x35e070>[object class: Job, number of selected objects: 1] (from bound object <MyTableView: 0x356490>): [<NSIndexSet 0x3946a0> addObserver:<NSArrayController 0x35e070> forKeyPath:@"properties.clientInfo.properties.name" options:0x0 context:0x0] was sent to an object that is not KVC-compliant for the "properties" property. 2005-06-10 07:21:50.876 CCLS Route[1405] [<NSIndexSet 0x3946a0> addObserver:<NSTableBinder 0x384cf0> forKeyPath:@"properties.category" options:0x0 context:0x0] was sent to an object that is not KVC-compliant for the "properties" property. 2005-06-10 07:21:55.300 CCLS Route[1405] [<NSIndexSet 0x3946a0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key properties.
If I quit the app after this, the object graph that gets archived is corrupted, and the app won't load it on the next launch.
This error happens after the drop (in tableDrop:acceptDrop:row:dropOperation). My best guess is that I'm confusing the KVO process somehow, specifically when there is a row selected during a drag. Do the messages above bear that out? As long as I "pre-select" the row/rows I'm going to drag, there is no issue dragging single or multiple rows. I *am* letting my array controller know about the actual shuffling of rows this way:
RouteList *rl = [[routeController selectedObjects] objectAtIndex:0]; // the master object containing the shuffled Jobs array object = [rl objectInJobsAtIndex:removeIndex]; [rl removeObjectFromJobsAtIndex:removeIndex]; [rl insertObject:object inJobsAtIndex:insertIndex];
Thanks!
#mikec |