iOS whose view is not in the window hierarchy问题解决

原因:不是用当前栈顶的控制器调用present方法就会出现这个问题

用栈顶的控制器调用present就行了  或者获取当前window的根控制器

UIViewController*top=[UIApplicationsharedApplication].keyWindow.rootViewController;

[top presentViewController:secondView animated:YES completion:nil];

你可能感兴趣的:(iOS whose view is not in the window hierarchy问题解决)