Can't find wha'ts wrong with it. Error Domain=NSCocoaErrorDomain Code=3840 “No value.”...











up vote
0
down vote

favorite












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()
}
}









share|improve this question




















  • 1




    Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
    – rmaddy
    Nov 11 at 1:07






  • 1




    This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
    – kelin
    Nov 11 at 9:05










  • Possible duplicate of "Reading from public effective user settings" in iOS 10
    – kelin
    Nov 11 at 9:05















up vote
0
down vote

favorite












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()
}
}









share|improve this question




















  • 1




    Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
    – rmaddy
    Nov 11 at 1:07






  • 1




    This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
    – kelin
    Nov 11 at 9:05










  • Possible duplicate of "Reading from public effective user settings" in iOS 10
    – kelin
    Nov 11 at 9:05













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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()
}
}









share|improve this question















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()
}
}






ios swift database






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 1:06









rmaddy

235k27306372




235k27306372










asked Nov 11 at 0:49









Sangwook Kim

1




1








  • 1




    Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
    – rmaddy
    Nov 11 at 1:07






  • 1




    This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
    – kelin
    Nov 11 at 9:05










  • Possible duplicate of "Reading from public effective user settings" in iOS 10
    – kelin
    Nov 11 at 9:05














  • 1




    Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
    – rmaddy
    Nov 11 at 1:07






  • 1




    This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
    – kelin
    Nov 11 at 9:05










  • Possible duplicate of "Reading from public effective user settings" in iOS 10
    – kelin
    Nov 11 at 9:05








1




1




Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
– rmaddy
Nov 11 at 1:07




Where is that error coming from? Is that from the print(error) line in your catch statement or somewhere else?
– rmaddy
Nov 11 at 1:07




1




1




This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
– kelin
Nov 11 at 9:05




This is not a serious error, this is just internal iOS message. stackoverflow.com/questions/40024316/…
– kelin
Nov 11 at 9:05












Possible duplicate of "Reading from public effective user settings" in iOS 10
– kelin
Nov 11 at 9:05




Possible duplicate of "Reading from public effective user settings" in iOS 10
– kelin
Nov 11 at 9:05

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244863%2fcant-find-whats-wrong-with-it-error-domain-nscocoaerrordomain-code-3840-no-v%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244863%2fcant-find-whats-wrong-with-it-error-domain-nscocoaerrordomain-code-3840-no-v%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine