Sort CoreData results using NSPredicate in Swift
问题 I'm currently writing a simple phone book app in Swift and need to sort the results from a CoreData query. Basically, I set up an NSManagedObject called "Directory", with the appropriate field names in - e.g. "name_f" is the user's name. The names in the CoreData database that is queried are in alphabetical order. However, although the first search returns the results in alphabetical order, further searches sometimes aren't after the database has been queried by other areas of the program. I