I'm working with Swift in Xcode and I receive the following error:
Value of type 'Category' (aka 'OpaquePointer') has no member 'name'
And I've looked everywhere but I can't find a solution. Does someone know what to do?
I'm working with Swift in Xcode and I receive the following error:
Value of type 'Category' (aka 'OpaquePointer') has no member 'name'
And I've looked everywhere but I can't find a solution. Does someone know what to do?
On
I also had this occur when attempting the exercise in the Angela Yu course where Category is a core data entity. I was using Xcode 11.3.1. After several attempts of setting the Module to Current Product Module and Codegen to Class Definition followed by Ctrl-B's to rebuild, I still received the error. However, restarting Xcode solved the problem and code completion was then able to suggest the name attribute/property.
On
Also in Angela's class. I found that by removing the core data models and reinitiating them as independent entities with no relationship, setting up the save and load functions, running the app, and then going back to link the relationship solved the issue. I think it has to do with saving the entities as NSManagedObject before being able to reference the attributes. I am guessing that without initiating them as an NSManagedObject the default type is Opaque Pointer. Best of luck!
On
I had the same problem. In my DataModel file, I changed entity name and the class name from "Category" to different one, such as "TodoListCategory." Then in my CategoryViewController, I changed all the Category objects to "TodoListCategory" and rebuild. It solved my problem.
After that, you might have error "Command CompileSwift failed with a nonzero exit code." Now, try to clean your project by using Shift + Command + K & Option + Shift + Command + K
On
I had same issue while been going through Angela Yu course and I had tried all of the available solution which I could find, but only this one has helped to me: while your project is opened:
do not use hotkey combination - just press it with your mouse! only this method help to me to get rid of this error.
Category did not provide name property