|
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. |
SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free! Sponsor Hacking with Swift and reach the world's largest Swift community! |
|
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 |
SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.