Is that thing using bubble sort? Or what exactly? How does it work in context with an NSFetchRequest of Core Data?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
NSSortDescriptorAPI does notspecify the algorithm (or even, like
virtually all of the Cocoa APIs, a
Big-O complexity guarantee). You
should assume that the sort
algorithm used is an implementation
detail. You should probably also
assume, however, that the algorithm
used is selected at run time for
best performance. Unless you have
hard requirements for time or memory
complexity, you should use the
public API and let the framework
authors at Apple worry abou the
details.
If you have complexity requirements,
you may find CHDataStructures
framework helpful in writing your
own collection/sorting
implementation.
For
NSFetchRequest, you should again assume that it is choosing an appropriate sort algorithm. In particular, sorting will be done by the SQLite engine, if possible, when using a SQL persistent store with Core Data.