|
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 |
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.