Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
let uid = FIRAuth.auth()?.currentUser?.uid
                let ref = FIRDatabase.database().reference().child("users").child((uid)!)
                ref.observeSingleEvent(of: .value, with: { snapshot in
                    
                    if let dictionary = snapshot.value as? [String: AnyObject] {
                        let htest = dictionary["h"] as! String  //Thread1: signal SIGABRT
                        var inthtest = Int(htest)
                        if (inthtest==0){
                            self.checkPointsk()
                            print("scanning1")


What I have tried:

I have tried changing the htest variable as string to as Int but still doesnt work
Posted
Comments
Richard MacCutchan 28-Apr-17 4:23am    
You cannot cast dissimilar types. If one is an integer and the other is a string then you must convert one of the values to the class type of the other.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900