class ViewController: UIViewController {
@IBOutlet weak var mavue: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let requestURL = NSURL(string: "http://www.google.com")
let request = NSURLRequest(URL: requestURL!)
mavue?.loadRequest(request)
println("myWebView : \(mavue)")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
println(" myWebView :( mavue)")return nil
我在模拟器上试试,我从presentViewController加载了我的controllerview可能是因为它的原因? 但是我的代码没有显示mywebview。 mywebView已连接到我的IBoutlet 谢谢
编辑:它的工作,我认为错误是保留默认的uiviewcontroller,当我使用子类时,一切正常感谢