Static NSDateFormatter variable (pg. 141)


#1

In the method -(IBAction)showCurrentTime:(id)sender, a static pointer variable of type NSDateFormatter is alloc-ed and init-ed.
What’s the best way to release this object? Obviously, you don’t want to release it inside the method and you can’t release it in the dealloc method because of out-of-scope issue. Is there a way to release it, without re-working the code (for instance placing the static variable in a global scope)?

Thanx in advance!