问题
Is it possible to change the UIApplication.delegate property at runtime to another class that implements the UIApplicationDelegate protocol so that from then on UIApplicationDelegate functions are called on the new class?
回答1:
You can very simply change it with [UIApplication sharedApplication].delegate = instanceOfDifferentClass
.
来源:https://stackoverflow.com/questions/28464515/possible-to-change-appdelegate-at-runtime