xcode 由于缺少入口点,场景无法访问...自定义按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25370723/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Scene is unreachable due to lack of entry points... Custom Button
提问by Yasir Ali
I'm new to programming on xCode. I've made a login screen in a snapchat format. Currently, I started with two view controllers one for login and then signup but I changed it so I start with an intial view controller that has two custom buttons I made. View the picture. I want it to be that so when you clean the login button it takes you to the login screen and when you click the sign up button it takes you to the sign up screen.
我是在 xCode 上编程的新手。我制作了一个 snapchat 格式的登录屏幕。目前,我从两个视图控制器开始,一个用于登录然后注册,但我更改了它,所以我从一个初始视图控制器开始,它有两个我制作的自定义按钮。查看图片。我希望如此,当您清除登录按钮时,它会将您带到登录屏幕,而当您单击注册按钮时,它会将您带到注册屏幕。
I'm not sure what I'm doing wrong. I want![enter image description here][1]
我不确定我做错了什么。我要![在此输入图片说明][1]
My app delegate has the following:
我的应用程序委托具有以下内容:
http://i.stack.imgur.com/8fWT4.pnghttp://i.stack.imgur.com/b9mfN.png
http://i.stack.imgur.com/8fWT4.png http://i.stack.imgur.com/b9mfN.png
I just don't understand as to why I keep getting the following error: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.
我只是不明白为什么我不断收到以下错误:由于缺少入口点,场景无法访问,并且没有通过 -instantiateViewControllerWithIdentifier: 进行运行时访问的标识符。
采纳答案by Tommy Devoy
Unless your segueing to the view in question, you would need to give it a storyboard identifier to connect the nib with the related class. Go into the storyboard and ensure you've set the class and storyboard id. If you're segueing to the class, ensure you give your segue an identifier. But if not, you can then do something like:
除非您转到相关视图,否则您需要为其提供故事板标识符以将笔尖与相关类连接。进入故事板并确保您已设置类和故事板 ID。如果您要转接班级,请确保为您的转接提供一个标识符。但如果没有,您可以执行以下操作:
YourViewController *vc = (YourViewController*)[self.storyboard instantiateViewControllerWithIndentifier:@"YourStoryboardIdentifier"];
[self presentViewController:vc animated:YES completion:^{}];// Or however you want to present it. ie pushing onto the navigation stack
回答by lonka
You can use this code:
您可以使用此代码:
WaitingRoomVC *ivc=[self.storyboard instantiateViewControllerWithIdentifier:@"waiting"];
[self.navigationController pushViewController:ivc animated:YES];