The dispatch_once singleton model is used to provide thread-safety. If you're positive that the singleton will only ever be accessed from the main UI thread (as it seems in this case) there's no substantial reason not to fall back to the older singleton model:
static NSDateFormatter* myFormatter;
+(NSDateFormatter*)mySingletonFormatter
{
if(!myFormatter)
{
myFormatter = [...];
}
return myFormatter;
}
+(void)resetMyFormatter
{
myFormatter = nil;
}
If you have to do both (reset in a multithreaded environment) the you can wrap the formatter creation and reset in @synchronized(self).
I would avoid modifying the private bits of dispatch_once_t since it's undocumented how it's used (although it's implied that resetting it to 0 will clear it, it's not documented.) To maintain thread safety, you would have to wrap the whole thing in semaphores anyway, so might as well just fall back to a known documented solution.