我在 LocationVC ViewController 上有一个变量“NameofCircle”,我在这个控制器上有变量 CName 我想通过 popToViewController 将 CName 值传递给 LocationVC Controller。我尝试了下面的代码,但没有得到结果。
let viewControllers = self.navigationController!.viewControllers
for aViewController in viewControllers
{
if aViewController is LocationVC
{
let Location = LocationVC()
Location.NameofCircle = CName
_ = self.navigationController?.popToViewController(aViewController, animated: true)
}
}