|
I'm having an issue with adding this code to ContentView as described in the lesson:
It is giving the error "Use of undeclared type Student" After searching the internet some, I found a post that suggested:
This appears to have work, as the error went away. But why did this work? Why couldn't Xcode recognize the Student entity that I created in my xcdatamodeld file? Has anybody else experienced this? I'd like to understand better what happened. |
|
i have had this issue before its due to Xcode not being able to find the automatically generated class. in your case Student Class is automatically generated & Xcode can detect that. The solutions i use is:
|
|
Thanks for the response! I spent half the day yesterday googling/trying different methods until the one that you suggested finally did the trick. |
|
|
|
|
|
|
|
For me, this fixed the issue but created another: ! Cannot preview in this file -- Bookworm.app may have crashed. Check... |
|
Unfortunately, I am experiencing the same problem as @smithi01, after following the steps suggested by @byaruhaf. I've been able to narrow the problem down somewhat - XCode compiles and runs the code just fine until i add the list code:
I've tried copying and pasting the code, typing out the code, closing and re-opening XCode, restarting the computer - nothing works. XCode only displays the "Cannot preview this file - Bookworm.app may have crashed" error message. XCode 11.6, Mac OS Catalina 10.15.5. UPDATE for anyone else having this problem. I was previewing the app in XCode's canvas. Can't remember where i came across this, but I saw somewhere that the canvas preview and Core Data don't always get along - something to do with errors when attempting to load the data. At any rate, I switched to using the simulator (as Paul was showing in his video) and it worked. |
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.
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.