Permalink
Browse files

Added a method to drop the cache if you get a memory warning.

  • Loading branch information...
1 parent 0fa7dbc commit 731301631c4272492cfd6962ad8a96ee939d4cfa Peter Hosey committed Oct 15, 2011
Showing with 9 additions and 0 deletions.
  1. +3 −0 ISO8601DateFormatter.h
  2. +6 −0 ISO8601DateFormatter.m
View
@@ -48,6 +48,9 @@ extern unichar ISO8601DefaultTimeSeparatorCharacter;
BOOL parsesStrictly;
}
+//Call this if you get a memory warning.
++ (void) purgeGlobalCaches;
+
@property(nonatomic, retain) NSTimeZone *defaultTimeZone;
#pragma mark Parsing
View
@@ -41,6 +41,12 @@ + (void) initialize {
}
}
++ (void) purgeGlobalCaches {
+ NSMutableDictionary *oldCache = timeZonesByOffset;
+ timeZonesByOffset = nil;
+ [oldCache release];
+}
+
- (NSCalendar *) makeCalendarWithDesiredConfiguration {
NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
calendar.firstWeekday = 2; //Monday

0 comments on commit 7313016

Please sign in to comment.