ios - swift 进行属性传值,穿过去的值为空.怎么解决?
迷茫
迷茫 2017-04-18 09:48:32
0
2
341

第一个页面
func pushView(){

    
    let secondVC = secondViewController()
    
    secondVC.titleGo = "百度一下"

    secondVC.address = "https://www.baidu.com"
    
    
    self.performSegue(withIdentifier: "secondViewController", sender: self)
    
    print("======")
    
}

第二个:


var address = String()

var titleGo = String()

var webView = WKWebView()

override func viewDidLoad() {
    
    
    itemBar.title = titleGo
    
    print("======+\(titleGo)")
    
    label.title = address
    
    print("++++++=\(address)")
    }
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
洪涛
navigationItem.leftBarButtonItem =
UIBarButtonItem(title: "返回", 
                style: .plain, 
               target: self, 
               action: #selector(ViewController.close))
小葫芦

If there is no problem with the code, it is just a location problem. The return button on this page needs to be set on the previous page

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template