我试图为另一个按钮制作actionsheet
,但我得到两个错误:"No visible @interface for 'UIstoryboard' declares the selector 'InitiateViewControll:'
和,"No visible @interface for SWViewController' declares the selector 'presentViewController:animated:'
我给这个代码,所以有没有什么名字,我需要命名,使这个代码适合我的代码?我正在努力学习我是一个noob对不起:(以下是我到目前为止拥有的代码:
- (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];
}
}
请帮助大家?
2条答案
按热度按时间7vhp5slm1#
试用此代码。. SWViewController必须有导航控制器
4uqofj5v2#
试试这个。对我很有效: