Do Cocoa NSSortDescriptors refer to model or controller?

Can subclasses be placed NSSortDescriptor

at the model or controller level?

Since they are primarily for display and business logic, it seems like it makes sense to put them in the Controller layer. But it also makes sense that models need to know how to sort themselves.

0


a source to share


1 answer


NSSortDescriptor ... subclasses?

Models

should know how to sort yourself.



Sorting is a problem with presentation to the user, making it more of a viewport and controller scope; models should generally avoid such things.

In Cocoa, you instantiate an NSSortDescriptor and store those descriptors in an array so you can use whatever you want to sort with. I can't think of a reason for subclassing NSSortDescriptor.

+3


a source







All Articles