2013-08-27 72 views
1

正如您所看到的,我正在尝试从Photo Action View Controller到设置视图控制器(UITableViewController)的performSeguePerformSegue无法正确执行

enter image description here

所以我从PhotoActionViewController直接(不使用按钮等),因为我想,当用户从显示AlertView一个选项水龙头来执行此SEGUE执行。一切工作都像魅力,直到我为SettingsViewController设置类。赛格表演但我看不到任何UITableViewCell。我怎么能得到这个工作形式?

这里是我的代码:

- (IBAction)imageViewTapped:(UITapGestureRecognizer *)sender 
{ 
    BlockAlertView *alert = [BlockAlertView alertWithTitle:@"New Photo" message:@"Decide what you would like to do with this photo"]; 

    [alert addButtonWithTitle:@"Create New Project" block:^{ 
     // Pushing to New Project Settings Controller 
     [self performSegueWithIdentifier:@"NPSSegue" sender:self]; 
    }]; 
    [alert addButtonWithTitle:@"Add To Existing Project" block:^{ 
     NSLog(@"Add to existing"); 
    }]; 

    [alert setCancelButtonWithTitle:@"Cancel" block:nil]; 

    [alert show]; 
} 

我没有张贴prepareForSegue,因为它是空的这一刻,我不知道如果有什么应该在那里。

+0

首先。不要将'self'传递给'performSegueWithIdentifier'只是传递'nil'。现在看其余的... – Fogmeister

+0

你可以显示'SettingsViewController'的代码。 – Fogmeister

+0

没有什么!只是从'UITableViewController'继承的新类如此,例如:'numberOfSectionsInTableView:'等 – cojoj

回答

2

每当以编程方式使用segue时,我们需要将segue通过一个场景连接到另一个场景(viewcontroller),因此创建一个按钮使其不可见并将其连接到目标场景并在uialertview中委托make按钮setEnabled:true和之前pls set赛格表示感谢和歉意穷英语.......

+0

谢谢我确信这个解决方案可以工作,但我想要的是避免创建隐形按钮。从'UITableViewController'中删除所有样板代码对我来说就像一个魅力! – cojoj