It's bad practice to create new instance of NSDateFormatter every time, when I call method. Creation of this object is too expensive. From Apple Data Formatting Guide:
Creating a date formatter is not a cheap operation. If you are likely to use a formatter frequently, it is typically more efficient to cache a single instance than to create and dispose of multiple instances. One approach is to use a static variable.
It's bad practice to create new instance of
NSDateFormatter
every time, when I call method. Creation of this object is too expensive. From Apple Data Formatting Guide: