简体   繁体   English

类型值没有成员

[英]Value of type has no member

I'm getting this error in "RoomTableViewController.swift", this is the prepare for segue function to go from this TVC to another one called ItemTableViewController 我在“ RoomTableViewController.swift”中遇到此错误,这是准备segue函数从此TVC转到另一个名为ItemTableViewController的函数

I tried checking my segue identifiers thinking there is a problem with it but no luck! 我尝试检查我的segue标识符,认为它有问题,但是没有运气! I also tried other solutions on stackoverflow. 我还在stackoverflow上尝试了其他解决方案。

I had it working earlier, but I don't know what I did to break it. 我早些时候可以使用它,但是我不知道该怎么做才能破解它。 The error is: 错误是:

value of type 'ItemTableViewController' has no member 'selectedRoom' 类型“ ItemTableViewController”的值没有成员“ selectedRoom”

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    if segue.identifier == "segueRoomTVC" {

    //Figure out which row was tapped
    if let row = tableView.indexPathForSelectedRow?.row {

        let tappedProperty = Property.getAllProperties()[row] as! Property

        //Figure out the destination viewController
        let roomTVC = segue.destinationViewController as! RoomTableViewController

        //Pass the object for that row to the next viewController
        I'm getting the error here ---> roomTVC.selectedProperty = tappedProperty

    }

  }
}

Let me know if you need more of my code to be submitted here 让我知道您是否需要在此处提交更多我的代码

I figured it out, I was passing the wrong data to the next VC. 我弄清楚了,我将错误的数据传递给了下一个VC。 Thanks for your help guys! 感谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM