|
Hi All, I have an app that was created with cloudkit as a capability. The app uses core data to save items that users add. When trying to show those items with a ForEach i get a Thread 1 EXC_BREAKPOINT error.
when i go to app delegate i see the following wirtten in purple after the line
All your help is appreciated. Kind Regards Adam |
|
Hi Adam How is the view presented? Is it through .sheet(). Also is your var myHumidorRow on a separate line below the FetchRequest or is it just overflow from the previous line? Dave |
|
The var is on a spererate line not overflowed and the view is just a view at this stage. It calls a sheet when a button is clicked but the view i am hoping to show is just a list. |
|
This is where the view comes from |
|
Hi Adam So the variable has to be on the same line as the @FetchRequeat so it should read as follows -
Also try putting you managed object context variable in your content view as well. See how you go now. Dave |
|
Hi Dave, I did both of those things and unfortunately had no luck. Still got the same error in the same place. Do you think it has anything to do with me using cloudkit. The persistant container has changed to
|
|
Although, the error on the same line has now changed to:
|
|
If i take the for each out the app works perfectly, obviously not showing the coreData
|
|
Try putting the ForEach back but change it to following -
|
|
That gives me:
On the same line |
|
Hi Adam, adventitious I had to deal with the same Issue today... I could solve the problem by attaching following line of Code to the Views, which are using the Data from CloudKit/CoreData... .environment(.managedObjectContext, (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext) Found in the Apple Developer Forum: https://developer.apple.com/forums/thread/121213 Best whishes Robert |
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.