I\'m writing some unit test code for a model class and want to simulate the behavior of the class during app exit and relaunch. I could achieve this by deleting and re-allocing
sure something like this would be fine for unit testing, you can turn it off for prod:
static MyModel *singleton = nil; + (id) sharedInstance { if(!singleton) { singleton = [self new]; } return singleton; } + (void)resetSingleton { [singlelton release]; singleton = nil; }