0

I was following a tutorial (https://www.simplifiedios.net/swift-php-mysql-tutorial/) and I hit a dead end.

I keep getting this error:

2018-11-10 19:34:31.931565-0500 team[85540:1441900] [MC] Reading from private effective user settings. Error Domain=NSCocoaErrorDomain Code=3840 "No value." UserInfo={NSDebugDescription=No value.}

This is my code:

import UIKit

class ViewController: UIViewController {

    let URL_SAVE_TEAM = "http://cgi.soic.indiana.edu/~kim882/journey/createteam.php"

    @IBOutlet weak var textFieldName: UITextField!
    @IBOutlet weak var textFieldMember: UITextField!

    @IBAction func Login(_ sender: UIButton) {
        //created NSURL
        let requestURL = URL(string: URL_SAVE_TEAM)

        //creating NSMutableURLRequest
        let request = NSMutableURLRequest(url: requestURL!)

        //setting the method to post
        request.httpMethod = "POST"

        //getting values from text fields
        let teamName = textFieldName.text
        let memberCount = textFieldMember.text

        //creating the post parameter by concatenating the keys and values from text field
        let postParameters = "name="+teamName!+"&member="+memberCount!;

        //adding the parameters to request body
        request.httpBody = postParameters.data(using: String.Encoding.utf8)

        //creating a task to send the post request
        let task = URLSession.shared.dataTask(with: request as URLRequest) {
            data, response, error in

            if error != nil {
                print("error is \(String(describing: error))")
                return
            }

            do { //parsing the response
                let myJSON = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary //converting resonse to NSDictionary

                //parsing the json
                if let parseJSON = myJSON {

                    //creating a string
                    var msg : String!

                    //getting the json response
                    msg = parseJSON["message"] as! String?

                    //printing the response
                    print(msg)
                }
            } catch {
                print(error)
            }
        }
        //executing the task
        task.resume()
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • 1
    Where is that error coming from? Is that from the `print(error)` line in your `catch` statement or somewhere else? – rmaddy Nov 11 '18 at 01:07
  • 1
    This is not a serious error, this is just internal iOS message. https://stackoverflow.com/questions/40024316/reading-from-public-effective-user-settings-in-ios-10 – kelin Nov 11 '18 at 09:05
  • Possible duplicate of ["Reading from public effective user settings" in iOS 10](https://stackoverflow.com/questions/40024316/reading-from-public-effective-user-settings-in-ios-10) – kelin Nov 11 '18 at 09:05

0 Answers0