- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我想在我的 TableViewController
中选择一个单元格。单元格的文本应该通过 segue 传输到 FirstViewController 的标签。我总是收到如下所示的错误。
标识符正确。
我的代码:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if (segue.identifier == "BackToCalculator") {
//let myRow = tableView.indexPathForSelectedRow().row+1
let vc = segue.destinationViewController as FirstViewController
vc.SelectedBundesland.text = "Test"
}
}
异常(exception):
0x103f1f5dc: jne 0x103f1f5d0 ; swift_dynamicCastClassUnconditional + 48 0x103f1f5de: leaq 0x3364d(%rip), %rax ; "Swift dynamic cast failed" 0x103f1f5e5: movq %rax, 0xa456c(%rip) ; gCRAnnotations + 8 0x103f1f5ec: int3
0x103f1f5ed: movq %r14, %rax
怎么了?
最佳答案
可能在比赛中迟到了,但遇到了完全相同的问题。这里的问题是您的 Segue 指向 Tab Controller ,而不是它需要跳转到的实际 ViewController。我指的是您提供给安东尼奥的第二张截图。如果你修复它应该可以正常工作。
关于ios - Swift:PrepareForSegue,Swift Cast 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25406309/
我正在使用模板主从应用程序。我从 SplitViewController 添加了一个模态 segue,并为其指定了标识符“DisplayLoginView”。 我从我的 detailViewContr
我很好奇这个方法 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender; 我在 UIViewController.h
我有一个 UINavigationController有一个 UITableview装在里面。里面这个UITableView我有一个 prototype细胞,我用静态数据重用了几次,这些数据永远不会改
我要函数,它们都触发performSegueWithIdentifier以同样的方式。但是根据调用哪个函数,我需要在 prepareForSegue 中传递不同的参数. 就像是 func first(
我已经有一段时间没有进行任何 iOS 编程了,所以请原谅我这个简单的问题。我已经搜索过了,也许我只是想多了。 我有一个名为 ShowStreamDetails 的 segue,将动态原型(protot
当我通过prepareForSegue将数据从FirstViewController传递到SecondViewController( TableView )时,我在secondViewControll
我的应用有核心数据和两个 View CoursesTableViewController 和 DetailViewController。 如果用户点击 Detail Disclosure 按钮转到 D
我有一个带有嵌入式导航 Controller 的 Storyboard (xcode5)(导航 Controller 指向我的主视图 Controller )。 我已经为我想通过我的代码打开的新 Vi
我的应用程序有一个非常奇怪的问题。我在我的应用程序中使用 AFNetworking 框架。我正在加载一些带有图像的提要,然后单击操作打开带有详细描述和大图像的新 View 。所以我将 IdPhoto
我设置了一个 View ,用户可以在其中选择一张照片,然后将其用作个人资料照片。一旦他们选择了图像,就应该更新 UIImageView 。我使用 prepareForSegue 方法将信息传递给包含
我有以下 3 种使用 Storyboard的方法,其中我有一个从“查看电影信息”按钮到下一个 View 的“segue”连接。标识符是“web” 当我单击按钮时,我调用此方法:(IBAction)sy
在我的应用程序中有一个 UITableView 显示 Core Data 对象。当用户点击一行时,必须显示所选对象的详细 View 。详细 View 在 EditToDoItemViewControl
我正在使用模态转场将数据从 SignUpViewController 传递到 RAVerificationViewController。出于某种原因,我的姓名、密码、电话和电子邮件值为零,但宿舍和角色
我确定我有两个 View Controller ,它们有适当的文件作为它们的类。 (ViewController1.swift 和 ViewController2.swift)我试图使用以下代码将数据
我在使用 prepareforSegue 的 View Controller 之间传递字符串 (StringVar) 时遇到问题。我已经研究了关于这个主题的各种教程,但我仍然没有成功(我是新手,所以问
我使用 prepareForSegue 方法将 location_id 从 LocationTableViewController 传递到 BeerTableViewController,以便在点击位
我正在使用 SWRevealViewController 构建侧边栏菜单。从菜单(UITableView)中选择一个元素时,我有选择正确 Controller 的方法。 segue 标识符/名称在 S
我正在从 Storyboard的世界转向没有 Storyboard的世界。我想知道在这种情况下如何实现 prepareForSegue 方法。因为此方法使用 segue 标识符,而我知道提供 segu
我想在 prepareForSegue 中运行一些代码。问题是我正在以编程方式更改 View ,因此未运行 prepareForSegue 函数。我也不知道如何运行它,因为我不能给它一个标识符。 准备
我正在制作一个表格 View ,其中包含 channel ,用户可以点击该 channel 进入该 channel 。当用户点击该 channel 时,我想从 firebase 获取 channel
我是一名优秀的程序员,十分优秀!