"Globally caching a thread-unsafe class instance" for thread-safe class
Issue #28
closed
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)
-
repo owner -
repo owner - changed status to resolved
In the next version, these diagnostics will be suppressed for
NSDateFormatter
andNSNumberFormatter
if the minimum deployment target is at least iOS 7. -
repo owner - changed status to closed
- Log in to comment
Thanks for reporting this. Diagnostics for
NSDateFormatter
can be suppressed by removing it from the default value of theclassNames
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.)