UIActionSheet
UIActionSheet 底部弹框
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"是否注销?" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"注销" otherButtonTitles:nil, nil]; [sheet showInView:self.view];
UIActionSheetDelegate
(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { // 点击了注销 [self.navigationController popViewControllerAnimated:YES]; } }
UIStoryBoard实现跳转
手动跳转
[self performSegueWithIdentifier:@"login2Contact" sender:nil];
执行过程
1.[self performSegueWithIdentifier]
2.创建Segue
3.设置来源控制器segue.sourceViewController=self
4.设置目标控制器segue.destionationViewController=目标控制器
5.执行prepare(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender UIViewController *vc = segue.destinationViewController; vc.title = [NSString stringWithFormat:@"%@的联系人列表", _accountField.text]; NSLog(@"%@-- %@",segue.sourceViewController,segue.destinationViewController); }