Using Realm and Charts with Swift 3 in iOS 10
Sami Korpela
11421

Hi Sami, thanks for putting this tute together, exactly what I’m needing for my app, unfortunately I’ve got two errors I don’t know what to do with and no one has mentioned them here yet. After I’ve created the Swift file for the VisitorCount class and then I pasted your code into the file I get an error on the “realm.add(self)” line that says “User of unresolved identified ‘self’” I thought maybe it was because I hadn’t added the rest of your code to the ViewController file so I added all of that (the button code, ViewDidLoad and functions) and then I got another error on the button code “visitorCount.save()” → “Value of type ‘VisitorCount’ has no member ‘save’”

So at this point, I’m stuck :( I’m thinking it might have something to do with how the new swift file w/ the class is getting associated to the overall project, like maybe I need to add it as a delegate from the ViewContorller file or something like that..l no idea? I’m not really a developer, so while I know what Classes are I don’t tend to “go there” when building my app.

Show your support

Clapping shows how much you appreciated jammyman34’s story.