TIC TCP Conn Failed [4:0x604000360300]: 1:61 Err(61) <1> HTTP load failed (error code: -1004

做~自己de王妃 提交于 2021-02-11 14:23:28

问题


I'm trying to handle a login with the Facebook SDK but I have this error:

2018-08-18 20:50:30.913552+0000 FoodTaskerMobile[1370:39985] TIC TCP Conn Failed [4:0x604000360300]: 1:61 Err(61)
2018-08-18 20:50:30.915921+0000 FoodTaskerMobile[1370:39985] Task <D93AC55D-9E5E-4B25-B48E-5799A19F5F3C>.
<1> HTTP load failed (error code: -1004 [1:61])

This is my class code:

class LoginViewController: UIViewController {
    @IBOutlet weak var bLogout: UIButton!
    @IBOutlet weak var bLogin: UIButton!

    var fbLoginSuccess = false
    var userType: String = USERTYPE_CUTOMER

    override func viewDidLoad() {
        super.viewDidLoad()

        if (FBSDKAccessToken.current() != nil) {
            bLogout.isHidden = false
            FBManagar.getFBUserData(completionHandler: {
                self.bLogin.setTitle("Continue as \(User.currentUser.email!)", for: .normal)
                // self.bLogin.sizeToFit()
            })
        }
    }

    override func viewDidAppear(_ animated: Bool) {
        if (FBSDKAccessToken.current() != nil && fbLoginSuccess == true) {
            performSegue(withIdentifier: "CustomerView", sender: self)
        }
    }

I just fixed a canOpenUrl issue (OSStatus error -10814.) and now error 1004 showed up.


回答1:


I think that this error appears in a real device and not in the simulator, this because the mac has a webserver running and so the simulator can resolve it, not the device (it hasn't a webserver on it).

The 1004 is a URLError.cannotConnectToHost

Try to use the mac ip instead of the localhost, you can try to use the local network ip if the webserver hasn't a public ip. Check if you can resolve the ip from your iPhone and then it should work.



来源:https://stackoverflow.com/questions/51922498/tic-tcp-conn-failed-40x604000360300-161-err61-1-http-load-failed-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!