Sorting of dates now works properly. I also changed the Coredata model to contain NSDates instead of strings with dates.