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

Inefficient use of NSDateFormatter #2

Closed
tomassliz opened this issue Feb 16, 2015 · 1 comment
Closed

Inefficient use of NSDateFormatter #2

tomassliz opened this issue Feb 16, 2015 · 1 comment

Comments

@tomassliz
Copy link

Instantiate NSDateFormatter is expensive operation and you use it exactly that way. You can read this in Apple documentation:

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.

@remirobert
Copy link
Owner

good to know thanks, i will probably make a static or a singleton. Thanks !

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