When debugging the code, a controller is displayed in the model mode. The Code is as follows:
Systemstyleviewcontroller * s = [[systemstyleviewcontroller
Alloc] init];
Uinavigationcontroller * nav = [uinavigationcontroller
Alloc] initwithrootviewcontroller: S];
S. modalpresentationstyle =
Uimodalpresentationformsheet;
S. modaltransitionstyle =
Uimodaltransitionstylefliphorizontal;
[Self
Presentmodalviewcontroller: s animated: Yes];
The error is:
Application tried to present modally an active controller
If the uinavigationcontroller line is blocked, the program runs normally.
// Uinavigationcontroller * nav = [[uinavigationcontroller alloc] initwithrootviewcontroller: S];
The conjecture may be that after the navigationcontroller is generated, the system considers it as active.
But push does.
[Self. navigationcontroller
Pushviewcontroller: s animated: Yes];