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

Issue #28 closed
Anonymous 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. Log in to comment