故事板viewcontroller正在打开?

时间:2013-05-14 05:59:48

标签: ios objective-c storyboard uialertview segue

当我点击我的登录按钮时,我想在我的应用程序中打开主视图控制器,但就在某一天它工作之前,但现在它无法工作,当我点击登录时,它将用户详细信息发送到服务器并提供一个服务器输出.from this输出如果它是“登录”然后我想移动到主视图控制器。我使用Preforsegue方法为下一个viewcontroller我的viewcontroller id是“App”和segue id也是“App”。这是我以前用于在login.now移动到下一个viewcontroller的代码。这不起作用..

在登录按钮内:这是在使用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

1 个答案:

答案 0 :(得分:0)

尝试为segue和view controller提供不同的id。显然,你必须在某个地方对应用程序进行一些更改并忘记它。还要检查故事板连接。尝试删除segue并再次给它。

相关问题