var current_date = NSDate()
var dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
var strDate = dateFormatter.stringFromDate(current_date)
dateFormatter.dateFromString(strDate)
var fname = personalFname.text
var lname = personalLname.text
var email = personalEmail.text
var gender = ""
var date = convDate
if personalGenderSwitch.on {
gender = "Female"
} else {
gender = "Male"
}
var country_code = personalCountryCode.text
var phone = personalPhoneNo.text
if personal_id == nil {
if let err = SD.executeChange("INSERT INTO personal_info(user_id, fname, lname, gender, dob, country_code, phone, created_at) values (?,?,?,?,?,?,?,?)", withArgs: [email, fname, lname, gender, date, country_code, phone, strDate]) {
let alert = UIAlertView()
alert.title = "Table"
alert.message = "Error inserting"
alert.addButtonWithTitle("Ok")
alert.show()
} else{
let alert = UIAlertView()
alert.title = "Table"
alert.message = "successfully inserted"
alert.addButtonWithTitle("Ok")
alert.show()
}
} else {
if let err_update = SD.executeChange("UPDATE personal_info SET fname = ?, lname = ?, gender = ?, dob = ?, country_code = ?, phone = ?, updated_at = ? WHERE personal_info_id = ?", withArgs: [fname, lname, gender, date, country_code, phone, strDate, personal_id!]) {
let alert = UIAlertView()
alert.title = "Table"
alert.message = "Error updating"
alert.addButtonWithTitle("Ok")
alert.show()
} else {
let alert = UIAlertView()
alert.title = "Table"
alert.message = "Record updated"
alert.addButtonWithTitle("Ok")
alert.show()
}
}
why am i getting the error "Type of expression is ambiguous without more context" in the place of withArgs[ ] ?? i got this error when i recently updated the xcode to 7.0.1 from version 6.4