【发布时间】:2013-08-30 01:48:34
【问题描述】:
如您所见,我正在尝试将 performSegue 从 Photo Action View Controller 更改为 Setting View Controller (UITableViewController)。
所以我直接从PhotoActionViewController 执行(不使用按钮等),因为我想在用户点击显示AlertView 的一个选项时执行此转场。在我为SettingsViewController 设置类之前,一切都像魅力一样工作。 segue 执行但我看不到任何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,因为它目前是空的,我不知道是否应该有任何东西。
【问题讨论】:
-
首先。不要将
self传递给performSegueWithIdentifier,只需传递nil。现在看看剩下的...... -
你能显示
SettingsViewController的代码吗? -
里面什么都没有!只是继承自
UITableViewController的新类,所以类似于:numberOfSectionsInTableView:等。 -
从
SettingsViewController中删除所有UITableViewController样板代码 -
明天会检查,因为有人拿了我的测试 iPhone
标签: ios storyboard segue uistoryboardsegue