aslanyanhaik / Quick-Chat

Real time chat app written in Swift 5 using Firebase
MIT License
1.84k stars 360 forks source link

Issue with Quick Chat #7

Closed roncook99 closed 7 years ago

roncook99 commented 7 years ago

Hello. Good program. Just learning swift. I am running Xcode 8.2.1. When I run your program, I get an error - Could not cast value of type 'NSNULL' to "NSDictionary'. Seems to stop in User.swift - Class Func info - let data = snapshot.value as! [String: String].

Have any ideas

Thanks,

Ron

bradybrisson commented 7 years ago

Same issue. Please release an updated version with the solution

roncook99 commented 7 years ago

Brady, remember Haik has posted this as s favor to the community. I'm trying to find a solution as you should be doing as well. We'll get it figured out.

Ron

razvanifteme commented 7 years ago
if let data = snapshot.value as? [String: AnyObject] {
                let name = data["name"]
                let email = data["email"]
                let link = URL.init(string: data["profilePicLink"] as! String)
                URLSession.shared.dataTask(with: link!, completionHandler: { (data, response, error) in
                    if error == nil {
                        let profilePic = UIImage.init(data: data!)
                        let user = User.init(name: name as! String, email: email as! String, id: forUserID, profilePic: profilePic!)
                        completion(user)
                    }
                }).resume()
            }
aslanyanhaik commented 7 years ago

thank you guys for your feedback, I will try to fix in this week.

bradybrisson commented 7 years ago

On Mon, Jan 30, 2017 at 7:28 AM Haik Aslanyan notifications@github.com wrote:

thank you guys for your feedback, I will try to fix in this week.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aslanyanhaik/Quick-Chat/issues/7#issuecomment-276050846, or mute the thread https://github.com/notifications/unsubscribe-auth/AYLLhThoQIzJSBCZvGbV4rOVykovNXnOks5rXdd9gaJpZM4LtDDw .

Thank you, we appreciate the help

aslanyanhaik commented 7 years ago

Hi everyone, the bug is fixed. I will close the issue if everything is working on your devices.

roncook99 commented 7 years ago

Hi. Just tried it and it crashes with an unhandled exception error. I'll try and gets little more info as to exactly what's happening.

Ron

aslanyanhaik commented 7 years ago

Hey @roncook99 please delete all files in derived data folder.

roncook99 commented 7 years ago

Thanks. I'll give it a try tonight!

bradybrisson commented 7 years ago

On Mon, Feb 6, 2017 at 9:47 AM roncook99 notifications@github.com wrote:

Thanks. I'll give it a try tonight!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aslanyanhaik/Quick-Chat/issues/7#issuecomment-277703641, or mute the thread https://github.com/notifications/unsubscribe-auth/AYLLhQf6VmfErRwF47mASWODl1mSH6gGks5rZzKNgaJpZM4LtDDw .

Thank you! I will also give it a try tonight

roncook99 commented 7 years ago

That did the trick! Works great! I will be adding some functionally such at changing profile after registering and maybe adding groups or rooms.

Ron