self.performSegue即使已命名,也无法找到Storyboard-segue-ID

问题描述 投票:0回答:1

我正在尝试以编程方式在LiveController.swift中进行搜索。相关的代码位在LiveController.swift

self.performSegue(withIdentifier:"openWelcomePage" ,sender:self)

引发错误:

2020-04-16 20:51:44.614413-0400 alpha[53206:2805423] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<alpha.LiveController: 0x101c248c0>) has no segue with identifier 'openWelcomePage''

这表示未命名segue。但是它有:

enter image description here

总体情节提要在这里:enter image description here

请注意,突出显示的NavigationController是源,它嵌入了Live,它附加在LiveController.swift上。搜索的目标是带有Log inSign up的页面。

[将按钮放入LiveController并将按钮从按钮拖动到Welcome视图并命名为buttonSegue时的注意:

 self.performSegue(withIdentifier:"buttonSegue" ,sender:self)

按预期方式模态显示页面。

ios swift xcode xcode4
1个回答
0
投票

这可能是几件事,所以请尝试以下修复:

  1. 清理并构建您的项目。然后,再次运行。
  2. 退出Xcode,打开项目并运行。
  3. Attribute Inspector中,删除openWelcomePage并留空。

希望这些建议中的任何一个都有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.