1
func getData() {
let myURLString = "http://ec2-54-201-235-38.us-west-2.compute.amazonaws.com/"+Hot+".php?radius=15&curr_time="+noww+"lat="+String(lat)+"&long="+String(long)
print(myURLString)
let myURL = NSURL(string: myURLString)!
var myCardsArray = [Card]()
let mySession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
let myDataTask = mySession.dataTaskWithURL(myURL) { (data, response, error) in
guard error == nil else {
return
}
//do stuff with the data that comes out of this
}
}
このコードはURLセッションを作成し、データを取得して配列に格納します。私はそれを残してすべての作品は、それを残しました。私はアプリを提出したとき、私はそれがIPV6のネットワーク上でクラッシュし、理由が分かりませんでした。私はNSURLSessionを使用しているので、それはうまくいくはずですか?IPV6がiOSをクラッシュして何が起こっているのかわからない