title: Problem getting selected row index in NSTableView with filter predicate
body: <p>I'm not sure I'm phrasing this properly, but basically I do this in my main app delegate:</p>
  
  <p>Application *app = [[Application alloc] initWithApplication:fullPath]</p>
  
  <p>The Application class has an initWithApplication method that takes in the path of an app and then sets the properties for appPath, name, etc. Then I add the new "app" object to the applications NSMutableArray:</p>
  
  <pre><code>if (app) [applications addObject: app];
  </code></pre>
  
  <p>The NSArrayController's content array is bound to the applications NSMutableArray, and then the various keys (appPath, name, etc) are set in the NSArrayController. I then have a table view with various columns bound to the different properties, e.g. one column for the name, one column from the path, etc.</p>
  
  <p>I then have a launch button that launches the app that is selected in the table view. For this I use this code:</p>
  
  <pre><code>Application *app = [applications objectAtIndex:[tableView selectedRow]];
  </code></pre>
  
  <p>Then I just use "app.appPath" as a reference to the path of the currently selected item. This works fine. The problem comes in when the table view contents are filtered using a filterPredicate. Basically it filters out all apps in the table view and leaves only the ones with a name that contains the phrase typed into the search box.</p>
  
  <p>The above method does not work because it gets the index of the item in the table view, and since all the items are not in the table view, the count gets messed up. For example say I have an app called MyApp.app which is item at index 25 of the applications array.</p>
  
  <p>The above code works well because the tableView and the applications array have the same number of objects. However filtering out the contents of the table view creates a difference in the number of objects, and therefore it launches the wrong app.</p>
  
  <p>I hope my explanation is not too confusing, but its hard to explain. Any way around this?</p>
  
  <p>Thanks</p>