Unresolved_Identifiers

I am new to Swift coding. Since my application will use extensively Forms, Tables and Database I am using a turorial from techtopia.com to help me get started — “An Example SQLite based iOS 10 Application using Swift and FMDB” —

https://www.techtopia.com/index.php/An_Example_SQLite_based_iOS_8_ Application_using_Swift_and_FMDB

 

The problem is that after I followed all the instructions I am still getting errors. Can anyone help to know what I need to do in the ViewController.swift file to address the errors?

 

The Errors are below:

let contactDB = FMDatabase (path: databasePath as String) — Use of unresolved identifier ‘FMDatabase’

 

@IBAction func saveData(_ sender: AnyObject) {                     — Only instance methods can be declared @IBAction

 

let contactDB = FMDatabase(path: databasePath as String)      — Use of unresolved identifier ‘FMDatabase’; Use of unresolved identifier ‘databasePath’

 

let insertSQL = “INSERT INTO CONTACTS (name, address, phone) VALUES (‘(name.text!)’, ‘(address.text!)’, ‘(phone.text!)’)” —

Use of unresolved identifier ‘address’ ; Use of unresolved identifier ‘name’ ; Use of unresolved identifier ‘phone’

 

if !result! {

                    status.text = “Failed to add contact”

print(“Error: (contactDB?.lastErrorMessage())”)

                } else {

                    status.text = “Contact Added” — use of unresolved identifier ‘status’

                    name.text = “”                          — use of unresolved identifier ‘name’

                    address.text = “”                      — use of unresolved identifier ‘address’

                    phone.text = “”                         — use of unresolved identifier ‘phone’

 

 

The same errors show up where ever the above code is used.

I am using an iMAC Mojave v. 10.14.3 with Xcode version 10.1 and Swift 5

Powered by WPeMatico

About

You may also like...

Comments are closed.