【发布时间】:2016-02-04 12:20:25
【问题描述】:
单击 AlertView 中的按钮后,我想跳转到另一个 viewController。 谁能给我一个样品?
问题更新——————
我正在尝试这种方式:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
if ([cell.reuseIdentifier isEqualToString:@"Logoff"]){
UIAlertController* alert = [UIAlertController alertControllerWithTitle:nil
message:@“Logoff?"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* Confirm = [UIAlertAction actionWithTitle:@“Confirm" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
[alert dismissViewControllerAnimated:YES completion:nil];
[self.performSegueWithIdentifier:@"ShowLoginView" sender:self];
LoginViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
[self.navigationController pushViewController:newView animated:YES];
}];
UIAlertAction* Cancel = [UIAlertAction actionWithTitle:@“Cancel" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];
[alert addAction:Confirm];
[alert addAction:Cancel];
[self presentViewController:alert animated:YES completion:nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
}
但我收到了这个错误: 在“GeneralSettingsTableViewController *”类型的对象上找不到属性“performSegueWithIdentifier”
我错过了什么吗?
【问题讨论】:
-
您能告诉我们您的尝试和遇到的问题吗?
-
你试过了吗?
-
您好,您有解决方案吗?否则我可以帮助您。
标签: ios uialertcontroller