0
NSString *hashKey = [NSString stringWithFormat:@"%lu%lu%lu", (unsigned long)format.hash, (unsigned long)timeZone.hash, (unsigned long)locale.hash];
NSDateFormatter *formatters = [NSDate sharedDateFormatters];
NSDateFormatter *cachedDateFormatter = formatters[hashKey];
私はこのラインでトラブルを抱えています:予想方法「NSDateFormatter *」
NSDateFormatter *cachedDateFormatter = formatters[hashKey];
は私に語った:期待辞書要素を読み込むためのメソッドオブジェクトに見つかりませんタイプの "NSDateFormatter *"
いくつかのコンテキスト:
+ (NSMutableDictionary<NSString *, NSDateFormatter *>*)sharedDateFormatters {
static NSMutableDictionary *dict = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
dict = [NSMutableDictionary new];
});
return dict;
}