Search results for

“SwiftData inheritance relationship”

4,986 results found

Post

Replies

Boosts

Views

Activity

Reply to Provisioning profile missing entitlement: com.apple.developer.icloud
Thank you for your replies. Unfortunately, this didn't help either. I developed an app with SwiftDate in a GroupContainer. The data model is stable, and all relationships are optional. The next step should be to switch to an iCloudContainer. Both computers are on the same network and have internet access and access to the developer account. I disabled and re-enabled automatic signing. No change. A comparison of the project.pbxproj files showed two new lines in the non-functional project: 913a913 CODE_SIGN_IDENTITY = Apple Development; 948a949 PROVISIONING_PROFILE_SPECIFIER = ; I manually deleted these two lines and restarted Xcode. There was no change in behavior; the same error occurred. I also manually downloaded the profile from the developer website and tried to sign it manually. But this deployment profile has the same error again: Entitlements: 8 included, 1 Missing What surprises me is that the working version on the MacBook lists 12 entitlements. The entitlements are identical on both systems
2w
SwiftData Models and SortDesc. Only Work in One Swift File
Hey everyone, I found a possible SwiftData Release-only issue with nested sort descriptors on an optional relationship. In a minimal repro, sorting a @Query by a nested optional relationship key path like: SortDescriptor(InvestigationPhotoAsset.imageAnalysis?.overallAestheticsScore, order: .reverse) works in Debug, but crashes at runtime in Release. The surprising part is that the crash depends on file layout: if the active SwiftData models and the sort logic are kept in the same Swift file, the app works if the same models are split into separate files, the Release build crashes, 'Debug' will also work The repro was reduced to just two SwiftData models: InvestigationPhotoAsset InvestigationImageAnalysis So this looks less like an app-modeling issue and more like a SwiftData/compiler/codegen issue related to nested sort metadata in optimized builds. If useful, I can also give you a slightly more formal version with a title and code snippet block. Please ch
4
0
260
3w
Reply to SwiftData Models and SortDesc. Only Work in One Swift File
I saw this post, but have not found anything there about the one file works, separate files crashes aspect. So I submitted a post. But in general yes, it is also about sorting on optional nested relationships. @nilsn26: Thanks for your feedback report and confirmation. I don't have a clear answer about why putting the models and the sort logic in a same Swift file avoids the crash either, but I think the technical nature here is that KeyPath.appending can't forward optionality, which is a known issue under the investigation of the Swift team. Best, —— Ziqiao Chen  Worldwide Developer Relations.
3w
Reply to FileManager.replaceItemAt(_:withItemAt:) fails sporadically on ubiquitous items
What's the best way of being careful about this, or do you just mean by using the item replacement directory where possible? As far as I know, there are only two ways of getting a temp directory: Everything you've described sounds like you're on the right track. The big thing is just not making assumption about the relationship between directories (/tmp/ and home are on the same volume) or capabilities (home directories are ALWAYS on volumes that support cloning). The killer here is the long tail, as there are just SO many different edge cases. LibZip is much faster on a volume that supports cloning Interesting. Are you primarily editing the contents of the zip file (so you end up modifying the data inside, but don't really change it's overall size or structure)? Cloning is a huge help if you can clone the contents and then modify but if your modifications end up changing the fundamental contents, then I wouldn't expect the difference to be nearly as large. At large scale, this eventually devolves to
Topic: App & System Services SubTopic: Core OS Tags:
3w
Reply to Waiting for Review: TestFlight 25+ days, Production 10 days, no communication.
Similar situation. First time app, macOS and iOS versions, no login, no account, no server - just plain SwiftData, CloudKit, and one in-app purchase to unlock lifetime access. TestFlight: macOS build: submitted Feb 09, 2026 -> approved Feb 11, 2026 iOS build: submitted Feb 09, 2026 -> waiting -> re-submitted by incrementing build number Feb 18, 2026 -> still waiting, status on Mar 12, 2026: 'Waiting for Review' In-app purchase: didn't require submission I got enough feedback from my macOS beta testing that I decided to go ahead with the final app approval submission. Production: macOS build: submitted Mar 06, 2026 -> approved Mar 09, 2026 iOS build: submitted Mar 06, 2026 -> still waiting, status on Mar 12, 2026: 'Waiting for Review' In-app purchase: status on Mar 12, 2026: 'In Review' Without the IAP approval, it doesn't even make sense to announce my macOS release to my network because the app will just lock up after 14 days if they're unable to purchase. Why are things happening
3w
Reply to Data Disappeared
Thanks for taking the time to share your question here. After reading your question, I’m finding myself with more questions than answers right now. Could you tell me what database you’re using (SwiftData)? Also, please specify the programming languages, frameworks, or tools you’re working with. The more details you can share, including code snippets and the versions of the tools you’re using (like Xcode, macOS, iOS, etc.), the better. Lastly, could you let me know which platform you’re aiming for? I'm sure someone in the community will be able to help once you have a chance to update your post. Albert Pascual
  Worldwide Developer Relations.
3w
Reply to Missing demo project
The companion sample code is this: Adopting SwiftData for a Core Data app, though it was updated for the SwiftData sessions in WWDC24 and WWDC25, and so is a bit different from the version published for WWDC23. Best, —— Ziqiao Chen  Worldwide Developer Relations.
3w
Missing demo project
Hi forum! I’m currently following a series of videos about SwiftData. In the WWDC23 Build an app with SwiftData video, it mentions that you can follow up with a demo project. However, I’m encountering an issue (at least in my case) where there’s no link on the entire page to download the project. I can download the video and other resources (even using the Developer’s App), but there’s no link for the project. Does anyone else face this issue? Is it possible that the project has been removed? I’m using my developer (single user) account, by the way. Any guidance would be greatly appreciated!
1
0
325
3w
Reply to ppq.apple.com returning 502 Bad Gateway - Unable to verify developer apps on device
I've gotten OK, Bad-Gateway, Gateway Time-Out on four different systems. Even when OK is returned, it takes a while to get a response. This started almost exactly at 10am pacific time for me. Like many of you I used the security command line to check my certs, checked my firewall (PFSense), and even switch my build system and my target iPad to use my iPhone personal hot-spot, in order to bypass my infrastructure and still, no-joy. After reading your posts, I have become convinced that this is an Apple services issue, even though their status page says everything is working. More information. I have another project (Project-B) I'm working on, which is being developed on a different machine. Project-B installs on the same target iPad with no issues. I migrated the failing project (Project-A) over to this machine and added the missing certificates to the keychain so that the failing project would build. Even on this second system, I'm consistently getting the error for project-a but not for project-b. So, appare
3w
Reply to Help Rescuing SwiftData Schema with Non-Optional Transformables
Thanks for the research - unfortunately, this still doesn't allow me to migrate databases. If I create a new SwiftData database with the NSSecureCoding TestTransformable, I can save, load, and migrate it successfully. However, if I have an existing SwiftData database that wasn't created with the NSSecureCoding TestTransformable, things are strange: Once the codebase is recompiled with the NSSecureCoding conformance applied, I can load the old database successfully. However, it still fails in the same way when I go to migrate the database. To be clear - NSSecureCoding fixes save/load/migrate on a new database, but when applied to an existing database (such as the one I have deployed to iCloud), only save/load works, and migration still fails. Below are the changes made to test NSSecureCoding: @objc(TestTransformable) //toggle between these declarations for testing //final nonisolated class TestTransformable: NSObject, Codable, Sendable { final nonisolated class TestTransformable: NSObject, Co
3w
Help Rescuing SwiftData Schema with Non-Optional Transformables
I currently have a schema in production (cloudKit and local files) containing non-optional transformable values, e.g. @Attribute(.transformable(by: TestTransformer.self)) var number: TestTransformable = TestTransformable.init(value: 100) Unfortunately, this is preventing any migration from succeeding (documented at length in FB22151570). Briefly summarized, any migration from a Schema containing non-optional transformable values fails between willMigrate and didMigrate with the error Can't find model for source store. This occurs for all migrations, including lightweight with a migration plan, lightweight without a plan, and custom migrations. Worst of all, this also prevents migration to optional transformable values, or the elimination of the transformable value entirely, leaving us completely stuck. (note: optional transformable values only work when they have a default value set to nil, otherwise even these have issues migrating) We already have features being blocked by this issue, and would like to pres
2
0
147
3w
Escalation to Apple Developer Leadership
Alright, so I'm gonna send an email out to Eddy, Matt and Susan. If anyone wants to be copied, paste your email address here. This is just beyond belief. It is unfortunate we have to let Apple leadership know this service is broken and most probably call out people (sadly). This sort of delay is severely severed my relationship with customers and users. I plan to send the email out over the week-end
4
0
337
3w
Reply to NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error: returning NSURLRelationshipSame for Different Directories
I'm not sure what you mean here. If you want to know the current path location, then you ask the kernel to convert the reference to a path. [..] I'm not quite sure what you're thinking of here. If you're trying to display the contents of a directory hierarchy, then the process is exactly the same for paths and references. You start with the container and recursively iterate its contents, displaying whatever you find. What about changes? FSEventStreamRef reports changes on a directory. Does it work on file reference urls? I never even thought of trying. I can pick up changes on a subfolder 4 folders away from the root folder I'm watching, all using a single FSEventStreamRef. I'm not saying it isn't possible I just don't know? how can I parse a single change using current APIs in a deep tree with opaque file reference urls that don't have a concept of location without first converting to path to see what level I'm at? Sure. Why not? That's what the Carbon File Manager did. Well I'm not totally against the idea
Topic: App & System Services SubTopic: Core OS Tags:
3w
Reply to NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error: returning NSURLRelationshipSame for Different Directories
I actually don't have a strong opinion about file reference URLs vs. file path URLs, but from my perspective in the sample, it is clear after the second call to createDirectoryAtURL:..., Yes, and to be clear, that is very much a bug. More specifically, every URL should either be a file reference URL (in which case you'd reference the object in the trash) or a file path URL (in which case you'd reference the original path). You're ending up with a URL which is a mix of both, which is simply wrong. I'd need to test on older OS's, but I suspect this is actually a new bug, possibly introduced in Swift Foundation[1] [1] Much of the Objective C version of Foundation is actually written in Swift now. Yeah. You can't even create a file without a path, so there is that. Unfortunately, yes. I'm not claiming my radical idea is something that will ever be (again) implemented. Keep in mind that I'm not claiming that macOS is wrong about paths; I think EVERY operating system is wrong about paths. Well, every operating syst
Topic: App & System Services SubTopic: Core OS Tags:
3w
CloudKit JS and Many-To-Many relationships
Hi, I'm having difficulties fetching many 2 many relationships. I have an Actor entity (which I can query in CloudKit JS) that has 2 relationships: inputComponents and outputComponents, both pointing towards a Component entity. How to query these relationships? Thanks Tom
Replies
2
Boosts
0
Views
1.3k
Activity
2w
Reply to Provisioning profile missing entitlement: com.apple.developer.icloud
Thank you for your replies. Unfortunately, this didn't help either. I developed an app with SwiftDate in a GroupContainer. The data model is stable, and all relationships are optional. The next step should be to switch to an iCloudContainer. Both computers are on the same network and have internet access and access to the developer account. I disabled and re-enabled automatic signing. No change. A comparison of the project.pbxproj files showed two new lines in the non-functional project: 913a913 CODE_SIGN_IDENTITY = Apple Development; 948a949 PROVISIONING_PROFILE_SPECIFIER = ; I manually deleted these two lines and restarted Xcode. There was no change in behavior; the same error occurred. I also manually downloaded the profile from the developer website and tried to sign it manually. But this deployment profile has the same error again: Entitlements: 8 included, 1 Missing What surprises me is that the working version on the MacBook lists 12 entitlements. The entitlements are identical on both systems
Replies
Boosts
Views
Activity
2w
SwiftData Models and SortDesc. Only Work in One Swift File
Hey everyone, I found a possible SwiftData Release-only issue with nested sort descriptors on an optional relationship. In a minimal repro, sorting a @Query by a nested optional relationship key path like: SortDescriptor(InvestigationPhotoAsset.imageAnalysis?.overallAestheticsScore, order: .reverse) works in Debug, but crashes at runtime in Release. The surprising part is that the crash depends on file layout: if the active SwiftData models and the sort logic are kept in the same Swift file, the app works if the same models are split into separate files, the Release build crashes, 'Debug' will also work The repro was reduced to just two SwiftData models: InvestigationPhotoAsset InvestigationImageAnalysis So this looks less like an app-modeling issue and more like a SwiftData/compiler/codegen issue related to nested sort metadata in optimized builds. If useful, I can also give you a slightly more formal version with a title and code snippet block. Please ch
Replies
4
Boosts
0
Views
260
Activity
3w
Reply to SwiftData Models and SortDesc. Only Work in One Swift File
I saw this post, but have not found anything there about the one file works, separate files crashes aspect. So I submitted a post. But in general yes, it is also about sorting on optional nested relationships. @nilsn26: Thanks for your feedback report and confirmation. I don't have a clear answer about why putting the models and the sort logic in a same Swift file avoids the crash either, but I think the technical nature here is that KeyPath.appending can't forward optionality, which is a known issue under the investigation of the Swift team. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
3w
Reply to FileManager.replaceItemAt(_:withItemAt:) fails sporadically on ubiquitous items
What's the best way of being careful about this, or do you just mean by using the item replacement directory where possible? As far as I know, there are only two ways of getting a temp directory: Everything you've described sounds like you're on the right track. The big thing is just not making assumption about the relationship between directories (/tmp/ and home are on the same volume) or capabilities (home directories are ALWAYS on volumes that support cloning). The killer here is the long tail, as there are just SO many different edge cases. LibZip is much faster on a volume that supports cloning Interesting. Are you primarily editing the contents of the zip file (so you end up modifying the data inside, but don't really change it's overall size or structure)? Cloning is a huge help if you can clone the contents and then modify but if your modifications end up changing the fundamental contents, then I wouldn't expect the difference to be nearly as large. At large scale, this eventually devolves to
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3w
Reply to Waiting for Review: TestFlight 25+ days, Production 10 days, no communication.
Similar situation. First time app, macOS and iOS versions, no login, no account, no server - just plain SwiftData, CloudKit, and one in-app purchase to unlock lifetime access. TestFlight: macOS build: submitted Feb 09, 2026 -> approved Feb 11, 2026 iOS build: submitted Feb 09, 2026 -> waiting -> re-submitted by incrementing build number Feb 18, 2026 -> still waiting, status on Mar 12, 2026: 'Waiting for Review' In-app purchase: didn't require submission I got enough feedback from my macOS beta testing that I decided to go ahead with the final app approval submission. Production: macOS build: submitted Mar 06, 2026 -> approved Mar 09, 2026 iOS build: submitted Mar 06, 2026 -> still waiting, status on Mar 12, 2026: 'Waiting for Review' In-app purchase: status on Mar 12, 2026: 'In Review' Without the IAP approval, it doesn't even make sense to announce my macOS release to my network because the app will just lock up after 14 days if they're unable to purchase. Why are things happening
Replies
Boosts
Views
Activity
3w
Reply to Data Disappeared
Thanks for taking the time to share your question here. After reading your question, I’m finding myself with more questions than answers right now. Could you tell me what database you’re using (SwiftData)? Also, please specify the programming languages, frameworks, or tools you’re working with. The more details you can share, including code snippets and the versions of the tools you’re using (like Xcode, macOS, iOS, etc.), the better. Lastly, could you let me know which platform you’re aiming for? I'm sure someone in the community will be able to help once you have a chance to update your post. Albert Pascual
  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
3w
Reply to Missing demo project
The companion sample code is this: Adopting SwiftData for a Core Data app, though it was updated for the SwiftData sessions in WWDC24 and WWDC25, and so is a bit different from the version published for WWDC23. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
3w
Missing demo project
Hi forum! I’m currently following a series of videos about SwiftData. In the WWDC23 Build an app with SwiftData video, it mentions that you can follow up with a demo project. However, I’m encountering an issue (at least in my case) where there’s no link on the entire page to download the project. I can download the video and other resources (even using the Developer’s App), but there’s no link for the project. Does anyone else face this issue? Is it possible that the project has been removed? I’m using my developer (single user) account, by the way. Any guidance would be greatly appreciated!
Replies
1
Boosts
0
Views
325
Activity
3w
Reply to ppq.apple.com returning 502 Bad Gateway - Unable to verify developer apps on device
I've gotten OK, Bad-Gateway, Gateway Time-Out on four different systems. Even when OK is returned, it takes a while to get a response. This started almost exactly at 10am pacific time for me. Like many of you I used the security command line to check my certs, checked my firewall (PFSense), and even switch my build system and my target iPad to use my iPhone personal hot-spot, in order to bypass my infrastructure and still, no-joy. After reading your posts, I have become convinced that this is an Apple services issue, even though their status page says everything is working. More information. I have another project (Project-B) I'm working on, which is being developed on a different machine. Project-B installs on the same target iPad with no issues. I migrated the failing project (Project-A) over to this machine and added the missing certificates to the keychain so that the failing project would build. Even on this second system, I'm consistently getting the error for project-a but not for project-b. So, appare
Replies
Boosts
Views
Activity
3w
Reply to Help Rescuing SwiftData Schema with Non-Optional Transformables
Thanks for the research - unfortunately, this still doesn't allow me to migrate databases. If I create a new SwiftData database with the NSSecureCoding TestTransformable, I can save, load, and migrate it successfully. However, if I have an existing SwiftData database that wasn't created with the NSSecureCoding TestTransformable, things are strange: Once the codebase is recompiled with the NSSecureCoding conformance applied, I can load the old database successfully. However, it still fails in the same way when I go to migrate the database. To be clear - NSSecureCoding fixes save/load/migrate on a new database, but when applied to an existing database (such as the one I have deployed to iCloud), only save/load works, and migration still fails. Below are the changes made to test NSSecureCoding: @objc(TestTransformable) //toggle between these declarations for testing //final nonisolated class TestTransformable: NSObject, Codable, Sendable { final nonisolated class TestTransformable: NSObject, Co
Replies
Boosts
Views
Activity
3w
Help Rescuing SwiftData Schema with Non-Optional Transformables
I currently have a schema in production (cloudKit and local files) containing non-optional transformable values, e.g. @Attribute(.transformable(by: TestTransformer.self)) var number: TestTransformable = TestTransformable.init(value: 100) Unfortunately, this is preventing any migration from succeeding (documented at length in FB22151570). Briefly summarized, any migration from a Schema containing non-optional transformable values fails between willMigrate and didMigrate with the error Can't find model for source store. This occurs for all migrations, including lightweight with a migration plan, lightweight without a plan, and custom migrations. Worst of all, this also prevents migration to optional transformable values, or the elimination of the transformable value entirely, leaving us completely stuck. (note: optional transformable values only work when they have a default value set to nil, otherwise even these have issues migrating) We already have features being blocked by this issue, and would like to pres
Replies
2
Boosts
0
Views
147
Activity
3w
Escalation to Apple Developer Leadership
Alright, so I'm gonna send an email out to Eddy, Matt and Susan. If anyone wants to be copied, paste your email address here. This is just beyond belief. It is unfortunate we have to let Apple leadership know this service is broken and most probably call out people (sadly). This sort of delay is severely severed my relationship with customers and users. I plan to send the email out over the week-end
Replies
4
Boosts
0
Views
337
Activity
3w
Reply to NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error: returning NSURLRelationshipSame for Different Directories
I'm not sure what you mean here. If you want to know the current path location, then you ask the kernel to convert the reference to a path. [..] I'm not quite sure what you're thinking of here. If you're trying to display the contents of a directory hierarchy, then the process is exactly the same for paths and references. You start with the container and recursively iterate its contents, displaying whatever you find. What about changes? FSEventStreamRef reports changes on a directory. Does it work on file reference urls? I never even thought of trying. I can pick up changes on a subfolder 4 folders away from the root folder I'm watching, all using a single FSEventStreamRef. I'm not saying it isn't possible I just don't know? how can I parse a single change using current APIs in a deep tree with opaque file reference urls that don't have a concept of location without first converting to path to see what level I'm at? Sure. Why not? That's what the Carbon File Manager did. Well I'm not totally against the idea
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3w
Reply to NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error: returning NSURLRelationshipSame for Different Directories
I actually don't have a strong opinion about file reference URLs vs. file path URLs, but from my perspective in the sample, it is clear after the second call to createDirectoryAtURL:..., Yes, and to be clear, that is very much a bug. More specifically, every URL should either be a file reference URL (in which case you'd reference the object in the trash) or a file path URL (in which case you'd reference the original path). You're ending up with a URL which is a mix of both, which is simply wrong. I'd need to test on older OS's, but I suspect this is actually a new bug, possibly introduced in Swift Foundation[1] [1] Much of the Objective C version of Foundation is actually written in Swift now. Yeah. You can't even create a file without a path, so there is that. Unfortunately, yes. I'm not claiming my radical idea is something that will ever be (again) implemented. Keep in mind that I'm not claiming that macOS is wrong about paths; I think EVERY operating system is wrong about paths. Well, every operating syst
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3w