title: NSArraycontroller selectionIndexes bindings
body: <p>I have the following set-up:</p>
  
  <p>A Window that has a splitView in which I display I NSCollectionView in the left view and a detailView in the right view. Both views are set-up in separate xibs. Furthermore I have a Datacontroller (of class NSArrayController) that manages a mutable Array of NSMutableDictionaries (moviesForChoice). The dataController is set-up as application delegate. The movie objects in the array have properties like (name, plot, genre etc.)</p>
  
  <p>so far so good...</p>
  
  <p>In the xib for the NScollectionview I bound a NSArraycontroller content property to my datacontroller via Application.delegate.moviesForChoice The collectionView accesses the arraycontroller.arrrangedObjects and arraycontroller.selectionIndexes. This works fine the contents are displayed and the selection works fine in the collectionview (my collectionviewItem renders a selection color)</p>
  
  <p>In the xib for the detailView I want to display information for the selected object in the collectionview. Therefore I also added an arraycontroller to the xib, bound the content aray to Application.delegate.moviesForChoice and bound the NSTextfields in the view to e.g. arraycontroller.selection.name</p>
  
  <p>Here comes my issue:
  everytime I open the window with the two xibs, my collectionview displays all movies that are for choice correctly, and the detailview displays the information for the 1st object in my collectionview. Whenever I click on a different movie in the collectionView the res. item renders a selection color, but the detailView doesn't update.</p>
  
  <p>My understanding of it would be that the DataController is not informed about updates in the selectionIndexes and can therefore not trigger an update in the detailView. Correct me if I'm wrong...</p>
  
  <p>To remedy this I tried to bind the selectionIndexes property of the arraycontroller in the collectionView xib to Application.delegate.moviesForChoice.selecionIndexes but this failed with:
   addObserver:forKeyPath:options:context:] is not supported. Key path: selectionIndexes</p>
  
  <p>I could imagine that this means that the datacontroller is not KVO compliant for my Array moviesForChoice, but I implemented the following methods for it:</p>
  
  <pre><code>  -(void)insertObject:(NSDictionary *)dict inMoviesForChoiceAtIndex:(NSUInteger)index {
      [moviesForChoice insertObject:dict atIndex:index];
  }
  
   -(void)removeObjectFromMoviesForChoiceAtIndex:(NSUInteger)index {
          [moviesForChoice removeObjectAtIndex:index];
      }
  
  -(void)setMoviesForChoice:(NSMutableArray *)a {
      moviesForChoice = a;
  }
  
  -(NSArray*)moviesForChoice {
      return moviesForChoice;
  }
  
  -(NSUInteger)countOfMoviesForChoice
  {
      return [moviesForChoice count];
  }
  
  - (void)addMovieForChoiceObject:(Movie *)anObject
  {
      [moviesForChoice addObject:anObject];
  }
  </code></pre>
  
  <p>So where am I wrong? How do I correctly bind to the selectionIndexes?</p>
  
  <p>You help is much appreciated!
  M</p>