If this formatting is used in only one place, the best solution is to set the formatting to the view, and this approach often works quite well. However, if you do not have a custom view, it is natural that this work can be used in the view controller. In the Cocoa version of the MVC version, view controllers offer great flexibility in how they manage views. (This is an important place that Cocoa MVC differs from SmallTalk MVC on which it is based.)
But what if you want to use the same formatting between views (or view controllers)? Then you define the formatting code in a subclass of NSFormatter (or use the existing NSDateFormatter in your case). You can transfer them, put them in ivars then or even create Singleton to hold them.
Why not just put it in the model in that case? Well, let's say you have four views that show the time this way, but then you add two other views that show the time as 00: 00.0, and then one view of the battery that shows hours and minutes. Now you need to continue to expand the model to handle these cases. The model is collecting more and more information about views. Saving formatting to formatting allows you to share code (and bug fixes) without polluting the model with this data. And views that have very special formatting needs can still have their own code.
There is no need to create separate subclasses of NSFormatter for each type of formatting. You can create one class MYObjectFormatter , which will use parameters such as "hours", "minutes", "seconds", etc. This will work just like NSDateFormatter in this regard, and will give you ease of use, while keeping the formatting code outside the model. This is exactly how the NSDate and NSDateFormatter separated.
source share