Heloo, i have this problem when im using contaienerView with static tableview. i want to pass my data from my main view controller to my tableview, and im having this break where it said my data is null, but it wasnt null because i already fill that data that i want to pass in. im using firebase and dictionary. heres my code :

my main controller : 

```
class MainController: UITableViewController, AddPatientController {

private var patientLists = [PatientList]() // empty array buat isi list yg isinya nama pasien
var Segue : String = "PatientName"
var Segue2 : String = "PatientNotes"
let user : User = Auth.auth().currentUser! 
private var rootRef : DatabaseReference!

override func viewDidLoad() {
    super.viewDidLoad()

    self.rootRef = Database.database().reference() 
    populateList()
}

private func populateList() {// 5. func buat fetch data dari db ke hp

    self.rootRef.child(self.user.emailWithoutSpecialChar).observe(.value) { (snapshot) in 

        self.patientLists.removeAll()

        let pasienListDict = snapshot.value as? [String:Any]  ?? [:] //7. ini berarti return buat kl dict nya kosong, ini buat akses ke valuenya yg isinya itu dict[String:Any]

        for (key,_) in pasienListDict {

            if let pasienlistdict = pasienListDict[key] as? [String:Any]{

                if let pasienlist = PatientList(pasienlistdict) {
                    self.patientLists.append(pasienlist)
                    // ini buat ngemasukin ke dalem dictionarynya, ini buat store datanya dan ngambil datanya dari firebase db
                }

            }
        }

        DispatchQueue.main.async {
            self.tableView.reloadData()
        }

    }

} override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

    if segue.identifier == Segue {
        let nc = segue.destination as! UINavigationController
        let addPatientName = nc.viewControllers.first as! AddListController
        addPatientName.delegate = self

        }

        else if segue.identifier == Segue2 {

        guard let indexPath = self.tableView.indexPathForSelectedRow else {return}

        let nc = segue.destination as! PasienProfileController
        nc.pasien = self.patientLists[indexPath.row] 
    }

}

```

and this is my controller that should recieve the data 

```
class NotesController: UITableViewController, AddNotesDelegate {

var pasien : PatientList!
private var rootRef : DatabaseReference! 

var Segue1 : String = "AddNotes"
var Segue2 : String = "PasienNotes"

override func viewDidLoad() {
    super.viewDidLoad()

    self.title = pasien.name // this is the line where my code break cause it says the data is null

    self.rootRef = Database.database().reference()

}

```

my pasienprofilecontroller and my pasienProfileTableController( the containverView one) :

```
class PasienTableController: UITableViewController {

@IBOutlet weak var dataKunjunganLbl: UILabel!
@IBOutlet weak var diagnosaPasienLbl: UILabel!
@IBOutlet weak var alergiPasienLbl: UILabel!

var delegete : PasienTableControllerDelegate?

var patientList = [PatientList]()

override func viewDidLoad() {
    super.viewDidLoad()

    tableView.dataSource = self
    tableView.delegate = self

}

class PasienProfileController: UIViewController {

@IBOutlet weak var TinggiLbl: UILabel!
@IBOutlet weak var beratLbl: UILabel!
@IBOutlet weak var GolDarahLbl: UILabel!
@IBOutlet weak var NamaLbl: UILabel!

@IBOutlet weak var ImagePic: UIImageView!

var pasien : PatientList!

@IBOutlet weak var ContainerView: UIView!

override func viewDidLoad() {
    super.viewDidLoad()

    self.ImagePic.makeRounded()
    self.NamaLbl.text = pasien.name

}

```

this is the image of my storyboard to get a clear picture of what im trying to do 

[![so my "Patient" view controller is my main controller, which after that it will show the profile pasien controller, which is uiview with container view that contain static tableview. and when i try to hit that " Data Kunjungan Pasien" Cell, it gets the error.](https://i.stack.imgur.com/3Xfrq.png)](https://i.stack.imgur.com/3Xfrq.png)

so my "Patient" view controller is my main controller, which after that it will show the profile pasien controller, which is uiview with container view that contain static tableview. and when i try to hit that " Data Kunjungan Pasien" Cell, it gets the error

so is theres something wrong with my logic? why it keep saying null while it can successfully show the data from Patient view to patientProfileView?

\*this is my git if you guys wanna clone and check my error <https://gitlab.com/afipermanaa/skripsi.git> 

Thanks for the help