UIAlertView,ActionSheet 选择之后调用rootViewController报错

获取rootViewController 的两种方式分别是:

UIViewController *root=  [[UIApplication sharedApplication] keyWindow].rootViewController;

AppDelegate appdelegate=(AppDelegate)[UIApplication sharedApplication].delegate;
UIViewController *rooViewController= [appdelegate window].rootViewController;

UIAlertView,ActionSheet 选择之后调用rootViewController报错_第1张图片
image.png

当UIAlertView ,ActionSheet 代理方法之后调用1.root 对象UIApplicationRotationFollowingController,2. rooViewController依然是你设置的windows.rootViewController

你可能感兴趣的:(UIAlertView,ActionSheet 选择之后调用rootViewController报错)