我正在尝试actionsheet
为另一个按钮创建一个,但出现两个错误:"No visible @interface for 'UIstoryboard' declares the selector 'InitiateViewControll:'
并且,"No visible @interface for SWViewController' declares the selector 'presentViewController:animated:'
我正在提供此代码,所以我需要在其中命名任何名称以使此代码适合我的代码吗?我正在努力学习我是一个菜鸟对不起:(这是我到目前为止的代码:
- (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 instantiateViewControll:@"storyboardViewName"];
//Push
[self.navigationController pushViewController:controller animated:YES];
//Modal
[self presentViewController:controller animated:YES];
}
}
请大家帮忙?