当我点击我的登录按钮时,我想在我的应用程序中打开主视图控制器,但就在前几天它工作但现在它不工作,当我点击登录时,它会将用户详细信息发送到服务器并提供一个服务器输出。如果它是“登录”,然后我想移动到主视图控制器。我为下一个视图控制器使用 Preforsegue 方法,我的视图控制器 id 是“App”,segue id 也是“App”。这是我用来在登录时移至下一个视图控制器的代码。现在这不起作用..
内部登录按钮:在使用 post 方法发送 url 之后..然后将执行以下代码
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSString * serverOutput= [[NSString alloc]initWithData:data encoding:NSASCIIStringEncoding];
NSLog(@"%@",serverOutput);
if(serverOutput!=NULL)
{
if([serverOutput isEqualToString:@"login"])
{
[self getDetails];
[self performSegueWithIdentifier:@"App" sender:self];
}
if(App)
[self performSegueWithIdentifier:@"App" sender:self];
[_alertView dismissWithClickedButtonIndex:0 animated:YES];
}
} ];
_alertView = [[UIAlertView alloc] initWithTitle:@"Please Wait..."
message:@"\n"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = CGPointMake(139.5, 75.5);
[alertView addSubview:loading];
[spinner startAnimating];
[alertView show];
当我执行 [self Detail] 方法时,“App”的值为 yes