"Globally caching a thread-unsafe class instance" for thread-safe class

Issue #28 closed
Former user created an issue

I am getting the above mentioned warning for storing instances of NSDateFormatter in a static variable although since iOS 7 NSDateFormatter is thread-safe. See NSDateFormatter Class Reference

Comments (3)

  1. Ali Rantakari repo owner

    Thanks for reporting this. Diagnostics for NSDateFormatter can be suppressed by removing it from the default value of the classNames option for this rule. I will consider automatically whitelisting this in certain cases (e.g. if the minimum deployment target is iOS 7+ — the situation on OS X is a bit more complicated, and whitelisting might not be such a good idea there.)

  2. Ali Rantakari repo owner

    In the next version, these diagnostics will be suppressed for NSDateFormatter and NSNumberFormatter if the minimum deployment target is at least iOS 7.

  3. Log in to comment