我有一个启动屏幕的代码,然后进入主登录屏幕。但这不是切换,而是给了我一个Thread 1 Breakpoint 1.2错误。
以下是代码:
func switchScreen() {
let mainStoryboard = UIStoryboard(name: "Storyboard", bundle: NSBundle.mainBundle())
let vc : UIViewController = mainStoryboard.instantiateViewControllerWithIdentifier("vcMainLogin") as UIViewController // this is the line giving the error
self.presentViewController(vc, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "switchScreen", userInfo: nil, repeats: false)
// Do any additional setup after loading the view.
}我已经将Storyboard ID设置为与类名相同的ID,但是它仍然给出了这样的结果,并且只在输出:(lldb)中。

发布于 2014-07-07 23:18:36
尝试将下面的代码放在ViewDidAppear中而不是ViewDidLoad中
NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "switchScreen", userInfo: nil, repeats: false)呈现控制器必须完全加载并出现在您可以对所述控制器进行切换之前。
发布于 2018-06-07 06:59:05
您可能不小心设置了断点。您必须禁用所有的应用程序断点。
您可以通过单击、->调试菜单->禁用断点来禁用所有断点
发布于 2017-08-25 05:50:32
从Debug菜单中搜索禁用断点,希望它能解决问题
https://stackoverflow.com/questions/24369475
复制相似问题