I have this function to load Json, works fine on the iPhone and watchkit simulator, but crashes when I'm installing it on the watch. Why?
func get(){
let url = NSURL(string: "http://www.ddd.com/xxx.php")
let data = NSData(contentsOf: url! as URL)
values = try! JSONSerialization.jsonObject(with: data! as Data, options: JSONSerialization.ReadingOptions.mutableContainers) as! NSMutableArray
}
debug :
dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
failed path:/var/run/mDNSResponder Socket:7 Err:-1 Errno:1 Operation not permitted
nw_resolver_create_dns_service_on_queue DNSServiceCreateConnection failed: ServiceNotRunning(-65563)function signature specialization <preserving fragile attribute, Arg[1] = [Closure Propagated : reabstraction thunk helper from @callee_owned (@unowned Swift.UnsafeBufferPointer) -> () to @callee_owned (@unowned Swift.UnsafeBufferPointer) -> (@out ()), Argument Types : [@callee_owned (@unowned Swift.UnsafeBufferPointer) -> ()]> of generic specialization of Swift.StaticString.withUTF8Buffer <A> ((Swift.UnsafeBufferPointer) -> A)