Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSDateFormatter is too expensive #16

Closed
tomassliz opened this issue Jan 8, 2014 · 1 comment
Closed

NSDateFormatter is too expensive #16

tomassliz opened this issue Jan 8, 2014 · 1 comment

Comments

@tomassliz
Copy link

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.

@billymeltdown
Copy link
Owner

Totally. This is fixed now on master :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants