Post

Replies

Boosts

Views

Activity

Reply to SwiftData Transformable with String Array
Ok, I think I figured it out. So.. when you generate SwiftData Objects from Core Data and if you have Transformable Data like above what I've done with an Array of Strings, you will get @Attribute(.transformable(by: "NSSecureUnarchiveFromData")) var yourArrayOfStrings: [String]? However, SwiftData is so good that it already recognizes these Array of Strings so having that Attribute confuses Xcode to thinking you're using NSKeyedUnarchiveFromData. The solution is to just delete that attribute like so... var yourArrayOfStrings: [String]? And it just works! The warning goes away in the Debugger.
Mar ’24
Reply to SwiftData error: NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Same issue with my transformable array of strings in Xcode 15.2 and iOS 17.3. I'm switching from CoreData to SwiftData and using NSSecureUnarchiveFromData. But still get this error and then the app crashes due to memory. Frustrating I can't move to SwiftData after all of the work I put into changing my code. Good thing I saved a copy of the CoreData version. https://developer.apple.com/forums/thread/744688
Jan ’24
Reply to Swiftdata + Cloudkit + Mac OS how to configure for existing Swift Data store
I had the same error. Right click on your SwiftData Model class name and Refactor to a different name. There are some Model names you can't use. Xcode never warns you, it just produces an error.
Replies
Boosts
Views
Activity
Nov ’24
Reply to SwiftData Transformable with String Array
Ok, I think I figured it out. So.. when you generate SwiftData Objects from Core Data and if you have Transformable Data like above what I've done with an Array of Strings, you will get @Attribute(.transformable(by: "NSSecureUnarchiveFromData")) var yourArrayOfStrings: [String]? However, SwiftData is so good that it already recognizes these Array of Strings so having that Attribute confuses Xcode to thinking you're using NSKeyedUnarchiveFromData. The solution is to just delete that attribute like so... var yourArrayOfStrings: [String]? And it just works! The warning goes away in the Debugger.
Replies
Boosts
Views
Activity
Mar ’24
Reply to SwiftData Transformable with String Array
It seems with a new Xcode update, the app doesn't crash anymore but still produces the error every time the variable is read from the model. So in a view when it's repeatedly read. The error floods my debugger and doesn't stop.
Replies
Boosts
Views
Activity
Mar ’24
Reply to SwiftData Transformable with String Array
Here is what the Transformer looks like in the CoreData version of the app. I tried changing to @Attribute(.transformable(by: "NSSecureUnarchiveFromDataTransformer")) too.
Replies
Boosts
Views
Activity
Mar ’24
Reply to SwiftData error: NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Same issue with my transformable array of strings in Xcode 15.2 and iOS 17.3. I'm switching from CoreData to SwiftData and using NSSecureUnarchiveFromData. But still get this error and then the app crashes due to memory. Frustrating I can't move to SwiftData after all of the work I put into changing my code. Good thing I saved a copy of the CoreData version. https://developer.apple.com/forums/thread/744688
Replies
Boosts
Views
Activity
Jan ’24
Reply to This build is using a beta version of Xcode and can’t be submitted
Same
Replies
Boosts
Views
Activity
Nov ’23
Reply to Unable to Add for Review - Xcode 15.0.1 - New apps and app updates must be built with the public (GM) versions of Xcode 11 or later
Same
Replies
Boosts
Views
Activity
Nov ’23
Reply to iOS 16.4.1: Image not Showing Within Geometry on a .sheet View
I had to go back to a UIViewControllerRepresentable as a temporary fix till this bug is resolved.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23