Thank You so much for answering!
As mentioned in the opening post, I am on macOS 14.7 and Xcode 15.4. I have an older iPad running iOS 18.2.1 and would like to check if my apps are working under iOS18.x (I can't yet update to Sequoia/Xcode16, but will do that as soon as possible).
I followed Your instructions, changed the code according to Your snippet - but I got still a blank, empty screen, no buttons, nothing after starting the SwiftDataFlashCardSample.
On my Mac, the sample works fine, as You described - but not on the real iPad (iOS18.2.1)
Can it be, that I have to run Sequoia/Xcode16 to use my apps (document based SwiftData)? No way to check using my existing systen (macOS 14.7/Xcode 15.4)?
Thank You very much and kind regards
Post
Replies
Boosts
Views
Activity
I downloaded the sample file You provided in Your answer, followed the course to get the final sample.
https://developer.apple.com/documentation/swiftui/building-a-document-based-app-using-swiftdata
Test under macOS: Perfect
Test under iOS18: won't work, same as with my apps
create the document based version of the sample
run it under macOS Sonoma, perfect
install the sample on the iOS18 device
run the sample
create a new file
-> blank screen, can't use the sample
Thank You very much for Your help!
Thank You so much for answering! Will try the sample and prepare one of my files.
after posting my answer, I spent some more time on that
I had no crashes under the iPhone simulator
same app started as 'on my Mac', crashes after 3 or 4 new records
Since I didn't had crashes when creating new records via sheet (2 empty TextFields and a button to create that record), I did the following:
in my model, I initialized two fields with a string (before, I initalized the fields with empty strings ("")), "Title..." and "Author...".
(title was the first field, clicking into that forced the crash)
After this change, I created about 12 records, no crash!
Hope that was the solution! Means that the empty string/attribute was the problem
same here. macOS 14.5, MacBook Pro M3
I can create some records (SwiftData) - and then, it crashes when I click into the first field of the new created record. Filling in one of the other TextFields seems to work, editing the record afterwards seems to work fine