执行SegueWithIdentifier在if语句中不起作用

我正在编程一个应用程序,检查您是否连接到无线networking。 我已经使用苹果开发者的例子“可达性”。 这个代码是写在一个视图控制器的具体信息连接到指定的WiFinetworking。 如果用户已经连接到WIFI,我想要应用程序去下一个赛格。 所以我用“performSegueWithIdentifier”插入了一个“else”语句。

- (void)checkForWIFIConnection { Reachability* wifiReach = [Reachability reachabilityForLocalWiFi]; NetworkStatus netStatus = [wifiReach currentReachabilityStatus]; if (netStatus!=ReachableViaWiFi) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"No WIFI available!", @"AlertView") message:NSLocalizedString(@"You have no wifi connection available. Please connect to a WIFI network.", @"AlertView") delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", @"AlertView") otherButtonTitles:NSLocalizedString(@"Open settings", @"AlertView"), nil]; [alertView show]; } else { [self performSegueWithIdentifier:@"gotoWelkom" sender:self]; } } 

但是,当我在模拟器中运行它,它不会去下一个赛格。

标识符是正确的,因为当我testingperformSegueWithIdentifier在一个button,它移动到下一个segue。 (我在视图中添加了一个button,并将performSegueWithIdentifier放入IBAction中)

有谁知道我做错了什么?