iPhone devices don't connect to Local server in App
<p>I set up a a local server on my <code>iOS</code> app using <code>AFNetworking</code> and it works fine when I'm using my <code>simulator</code> but when I plug in my iPhone I get an <code>error: cannot connect to server</code> </p>

<pre><code>func postStripeToken(token: STPToken) {

    let URL = "http://localhost/donate/payment.php"
    let params  : [String: AnyObject] =  ["stripeToken": token.tokenId,
                                          "amount": totalPrice,
                                          "currency": "usd",
                                          "description": self.emailTextField.text!]

    let manager = AFHTTPRequestOperationManager()
    manager.securityPolicy.allowInvalidCertificates = true;

    manager.POST(URL, parameters: params, success: { (operation, responseObject) -&gt; Void in

        if let response = responseObject as? [String: String] {
            UIAlertView(title: response["status"],
                message: response["message"],
                delegate: nil,
                cancelButtonTitle: "OK").show()
</code></pre>

<p>This is the code where I get the error. I tried changing <code>localhost</code> to my computers <code>IP</code> address but that did not resolve my problem. Thanks!</p>