Uiimagepickercontroller *picker = [[Uiimagepickercontroller alloc] init];
[Self Presentviewcontroller:picker animated:yes completion:nil];
Into
Uiimagepickercontroller *picker = [[Uiimagepickercontroller alloc] init];
Appdelegate *delegate = (appdelegate *) [uiapplication sharedapplication].delegate;
[Delegate.window.rootViewController presentviewcontroller:picker Animated:yes completion:^{
}]; Theoretically it is allowed to present from one controller to another controller, and then from this controller present another controller.
I looked it up on the Internet. One of the great gods explained this:
In general, we present a viewcontroller content, often in the form of using Navigationcontroller and Tabbarcontroller to manage the view controller. In this case, the rendered view controller is inside an app-maintained controller stack.
In one case, a view controller can also be rendered by Self.view Addsubview:AviewController.view. While this may seem like the result of a push, the actual controller of the rendered view is not in the current app's view stack, which is called
Detachviewcontroller, if you make a present call in a view controller outside of this separation, the problem arises.
So deciding whether to split the view is to see if it is in the current app's controller stack.
Obviously app's Rootviewcontroller is on the stack, and it's the bottom-most view controller of the stack. So this kind of solution is to some extent feasible.