Swift http req。不经历

时间:2015-07-25 05:44:42

标签: swift http minecraft

//
//  FirstViewController.swift
//  XeGaming
//
//  Created by Brodie Andrew on 6/14/15.
//

import UIKit

class FirstViewController: UIViewController {

@IBOutlet var Count: UILabel!
@IBOutlet var MainDisplay: UIWebView!
override func viewDidLoad() {
    super.viewDidLoad()
    let url = NSURL(string: "http://creepertech.net/app/app_urlGrabber.php?url=http://xegaming.com")
    let request = NSURLRequest(URL: url!)
    MainDisplay.loadRequest(request)
    // Do any additional setup after loading the view, typically from a nib.

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
@IBAction func rel(sender: AnyObject) {
    let url = NSURL(string: "http://creepertech.net/app/app_urlGrabber.php?url=http://xegaming.com")
    let request = NSURLRequest(URL: url!)
    MainDisplay.loadRequest(request)
}

@IBAction func ch(sender: AnyObject) {
    let url = NSURL(string: "http://creepertech.net/app/app_urlGrabber.php?url=http://ihasabucket.com")
    let request = NSURLRequest(URL: url!)
    MainDisplay.loadRequest(request)
}


}

此页面上的http req和我的应用程序的第二页只生成一个白色空白屏幕,这两个页面都指向xegaming.com,应用程序URL抓取器也处理第三页和第四页,两者都工作< / p>

1 个答案:

答案 0 :(得分:0)

我认为你错过了 NSURLSession ,这里有一个如何正确使用NSURLSession的链接:Link

希望这有帮助! :d