When a UIApplicationDelegate is instantiated from:
UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]))
Tthe AppDelegate remains in memory even though the [[UIApplication sharedApplication] delegate]
property is a weak reference.
However, if you unset and re-set the delegate property, like so:
id originalDelegate = [[UIApplication sharedApplication] delegate];
[[UIApplication sharedApplication] setDelegate:nil];
[[UIApplication sharedApplication] setDelegate:originalDelegate];
then it becomes invalid to use. Any idea why it initially is fine with a weak reference?