IOS 页面跳转问题:点击按钮页面不跳转

在iOS应用中,从登录页面进入我的页面再进行注销操作后,返回登录页面,点击登录按钮无法触发页面跳转。问题出现在使用AppDelegate设置rootViewController时。在尝试通过NavigationController推送PreGWController时,代码执行但页面无响应。解决方案可能涉及正确设置NavigationController和检查控制器实例的状态。
摘要由CSDN通过智能技术生成

问题:每次运行模拟器进入(登录页面->我的页面->注销)没有问题,但是注销后回到登录页面,再点击登录就没有反应了。

AppDelegate:

LoginViewController *loginViewController = [[LoginViewController alloc]init];
if ([loginViewController isKindOfClass:[LoginViewController class]]) {
     _navigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController];
}

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor =  [UIColor whiteColor];
self.window.rootViewController = _navigationController;
[self.window makeKeyAndVisible];

我的页面中的注销:
LoginViewController *logView = [[LoginViewController alloc]init];
AppDelegate *myDelegate = [[UIApplication sharedApplication] delegate];
myDelegate.window.rootViewController = logView;

点击按钮进入PreGWController 再登录:
代码点击后没反应:
if (_pregw==nil) {

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值