|
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 Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community! 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 Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!
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.