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()
}
}
ios swift database
add a comment |
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()
}
}
ios swift database
1
Where is that error coming from? Is that from theprint(error)
line in yourcatch
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
add a comment |
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()
}
}
ios swift database
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
ios swift database
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 theprint(error)
line in yourcatch
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
add a comment |
1
Where is that error coming from? Is that from theprint(error)
line in yourcatch
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Where is that error coming from? Is that from the
print(error)
line in yourcatch
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