swift webview 显示空白,请问怎样解决?
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var baiweb: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
baiweb.loadRequest(NSURLRequest(URL:NSURL(string:"http://www.baidu.com")!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
后来换成www.sina.com.cn也不行
上面的代码运行以后,显示的是空白,请问各位大拿是怎么回事呢?
本人是小白,还请帮忙。谢谢
环境:XCODE7.1
语言:swift