|
Hi guys, Here is the code:
I know that the line that trigger the crash of the preview is this: Do you know how to solve? Thanks |
|
|
|
@deirdresm
Yes, it crashes in this line: I tried to comment it and it works fine without crashing. But I don't know why... |
|
hi, the thing that sticks out to me is that you are not making calls to a fixed DataController that was passed in, say, through the environment. rather, all your calls have the form
which means that every such call creates its own instance of a DataController. for example, the statement
creates a new data controller, adds a new note, and then this instance of a data controller goes away. similarly, i would think that
always returns a nil value, since a new data controller instance has (probably) no notes. (i can't tell exactly what hope that helps, DMG |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.