小编Dmi*_*ork的帖子

ios segue条件

我试图在一些条件后执行segue.我在主Storyboard中创建了modal segue,从nextPushed按钮到下一个视图控制器.

(IBAction)nextPushed:(id)sender {
//Perform check that every field /date/from/to/ choised and exists  
NSString *fromText = [NSString alloc];
NSString *toText = [NSString alloc];
NSString *pasNumText = [NSString alloc];
NSString *dateText = [NSString alloc];
dateText = self.dateAndTimeLabel.text;
fromText = self.fromLabel.text;
toText = self.toLabel.text;
pasNumText = self.numOfPassengersLabel.text;
if (!([fromText isEqual:@"Choice" ]) && !([toText isEqual:@"Choice"] ) && !([pasNumText isEqual:@"Choice"]) && !([dateText isEqual:@"Choice"])) {
    NSLog(@"All fields choisen");
    NSLog(@"Going to next view");
    [self performSegueWithIdentifier:@"goToDannie" sender:sender];
} else {
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Warning" message:@"Not all …
Run Code Online (Sandbox Code Playgroud)

iphone ios

3
推荐指数
1
解决办法
2263
查看次数

标签 统计

ios ×1

iphone ×1