Commits

Peter Hosey committed 2bb1725

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

Comments (0)

Files changed (2)

ISO8601DateFormatter.h

 	BOOL parsesStrictly;
 }
 
+//Call this if you get a memory warning.
++ (void) purgeGlobalCaches;
+
 @property(nonatomic, retain) NSTimeZone *defaultTimeZone;
 
 #pragma mark Parsing

ISO8601DateFormatter.m

 	}
 }
 
++ (void) purgeGlobalCaches {
+	NSMutableDictionary *oldCache = timeZonesByOffset;
+	timeZonesByOffset = nil;
+	[oldCache release];
+}
+
 - (NSCalendar *) makeCalendarWithDesiredConfiguration {
 	NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
 	calendar.firstWeekday = 2; //Monday