別の UiView/Page を開くには、ボタン (「続行」) を作成する必要があります。私は開発に非常に慣れていません。誰かが私にこれを教えてくれますか?ありがとう、皆さんは私にとって大きな助けです。
コード:
- (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];
}
}