sortingnstableviewnstabview

sorting doesn't work in nstableview


I have an core data, non document based os x app. I use NSTabView to display different data. In the third tab, I have NSTableView, and i display some records there. I am trying now to sort the data by e-mail. In my e-mail field I have set the Sort Key to emailAddress (attribute name in my entity), and in the selector field, I have caseInsensitiveCompare:

However, when I run the app, there is no default sorting (small arrow is not present in the cell title bar,) and when i click on the title, the small arrow do appear and change the direction on click, but records does not change the order. I don't get any error message, but records remain as they are without to change their order.

One more thing to mention here, my array controller has the option Prepare Content unchecked, because that specific NSTableView displays only the selected records from another NSTableView.

Just to mention here that if I click on the column title, the whole column becomes selected, which is not what I want.

I would appreciate any lead or clue on why sorting is not working in my case.


Solution

  • I just solve my problem. Here is the solution in case that someone hit the same problem.