Post

Replies

Boosts

Views

Activity

Reply to SwiftData iOS18: "Could not materialize Objective-C class named "Set" from declared attribute value type "Set<String>" of attribute named..."
I just stumbled onto the same problem, and I still can't find a solution documented online. But I had read already, that CoreData has issues with arrays of strings. What seems to work is creating a different data type when it comes to storing... The simplest solution for me was to convert the array to a string before storing, if you don't want to create a new class, as suggested in the comments. In my case it looks like this: private var longString: String = "" var strings: [String] { get { longString.isEmpty ? [] : longString.components(separatedBy: .newlines) } set { longString = newValue.joined(separator: "\n") } }```
May ’25
Reply to No macro named 'Preview' - error
I forgot to mention that code completion was working. I fiddled around some more: I created a new project, imported all the files (all but the @main App file) and the error appeared, again. On the ContentView file from the template! I tried to import the files one by one, but I got crazy with all the dependecy errors I get, some seem to be importable without invalidating said macro. And no, I did not redefine the macro in any file, or anything :/ So I'm hoping someone else runs into the same problem with easier code and will try to work without previews on this project. Or use the old content_providers.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23