Мне нужно сделать кнопку («Продолжить»), чтобы открыть еще один UiView/Page. Я очень новичок в развитии. Может кто-нибудь, пожалуйста, поймать меня, хотя это? Спасибо, вы, ребята, очень помогли мне.Использование UiActionSheet в раскадровке?
Код:
- (IBAction)OpenActionSheetButton:(id)sender {
UIActionSheet *actionsheet = [[UIActionSheet alloc]initWithTitle:@"There is no going back, are you sure???" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Continue" otherButtonTitles:nil, nil];
[actionsheet showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"storyboardViewIdentifier"];
//storyboardViewIdentifier is the ViewController identifier you specify in the storyboard
//PUSH
[self.navigationController pushViewController:controller animated:YES];
//Modal
[self presentViewController:controller animated:YES completion:Nil];
}
}
Это то, что я сделал с кодом:
- (IBAction)OpenActionSheetButton:(id)sender {
UIActionSheet *actionsheet = [[UIActionSheet alloc]initWithTitle:@"There is no going back, are you sure???" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Continue" otherButtonTitles:nil, nil];
[actionsheet showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
if(buttonIndex == 0)
[self performSegueWithIdentifier:@"openView" sender:self];
UIViewController *controller = [self.storyboard
instantiateViewControllerWithIdentifier:@"storyboardViewIdentifier"];
//storyboardViewIdentifier is the ViewController identifier you specify in the storyboard
//PUSH
[self.navigationController pushViewController:controller animated:YES];
//Modal
[self presentViewController:controller animated:YES completion:Nil];
}
}
есть ли отображаемый номер? – ApolloSoftware
Да, это так :) Просто когда я нажимаю «Продолжить», он явно закрывает. – user212803
Зачем вам нужно одновременно управлять контроллером вида и настоящим контроллером представления? Вы должны выбрать только один. –