The following code will deselect the index of an NSArrayController leaving the controller without a selected index. This works well when observing key value “selectedIndex” of NSArrayController when the user is selecting in two different arrays and a reset of the indexes is required to get an observation notice.
-(IBAction)resetArraySelection:(id)sender
{
NSIndexSet *indexEmptySet= [NSIndexSet indexSet];
NSLog(@”manual switching”);
if (manual) {
//NSArrayController 1
[boxList setSelectionIndexes: indexEmptySet];
}else{
//NSArrayController 2
[DeviceArrayController setSelectionIndexes: indexEmptySet];
}
}