I recently encountered an issue involving Core Data’s new Composite Attributes feature and thought I would share my experience, as well as seek clarification.
I created a composite type where all attributes were mandatory, except for one. Subsequently, I added an attribute to an entity and set its type to that composite type. Upon running the app, the console output the following error:
CoreData: error: CoreData: error: Row (pk = 85) for entity ‘(EntityName)’ is missing mandatory text data for property ‘(propertyName)’
The way I resolved this was by removing the composite type attribute from the entity, after which the error no longer appeared. I also observed that in another entity, where a different composite type is used, all the attributes were optional — and no error occurred.
This raises the question: why must all attributes in a composite type be optional? Furthermore, why does Xcode not inform the developer of this requirement? I have reviewed both the documentation and the WWDC23 “What’s New in Core Data” session, but neither mentions that having non-optional attributes within a composite type will cause such errors and lead to unpredictable application behaviour.
Additionally, this issue remains unresolved in another area I raised previously in this topic:
Composite Attributes feature requires tvOS deployment target 17.0 or later
Composite Attributes feature requires watchOS deployment target 10.0 or later
However, I do not have a tvOS or watchOS target, nor do I intend to add one.
Could someone from Apple, or anyone with more experience, please clarify why all attributes within a composite type must be optional? And could it be possible for Xcode to flag this at compile time, rather than failing at runtime?
Thank you in advance.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I updated to Xcode Version 16.3 (16E140) on macOS Sequoia 15.3.2 (24D81). I noticed the contextual menu is missing the Copy submenu. This submenu is accessible from the Main Menu under Edit menu.
You can see that the contextual menu is missing the Copy submenu, it was there prior to Xcode Version 16.3 (16E140).
Why was it removed? Could this Copy submenu be restored in future updates, please?
How do I resolve these errors reported in Xcode about using Core Data Composite Attributes feature?
Composite Attributes feature requires tvOS deployment target 17.0 or later
Composite Attributes feature requires watchOS deployment target 10.0 or later
My app is a Cocoa app and targets macOS 14.0+. I do not have an iOS, iPadOS, tvOS nor watchOS targets. So, I don't understand why I am getting these errors.
My Xcode project format is set to Xcode 16.0.
I am on macOS Sequoia 15.2 (24C101) and using Xcode Version 16.2 (16C5032a).
If you create a new Xcode project and choose macOS > App and Storage > Core Data and then Add Composite Type and set an attribute name and type, you will get the errors.
I wrote a Keychain controller that add, delete and fetch keychain items using SecItemAdd(_:_:)and related APIs with data protection keychain enabled (kSecUseDataProtectionKeychain). I am using it in a macOS Cocoa app.
I am using Swift Testing to write my tests to ensure that the controller works as expected.
As I understand, I should create my own keychain for testing rather than use the actual keychain in macOS. Currently, I created a separate keychain group (e.g. com.testcompany.testapp.shared) and added it to myapp.entitlements file so that the tests pass without failing because of the missing entitlement file.
SecKeychainCreate(_:_:_:_:_:_:) and SecKeychainDelete(_:) API are deprecated with no alternative provided in the documentation. I noticed SecKeychain class but documentation doesn't explain much about it.
How should I test my keychain controller properly so that it does not use the actual macOS keychain, which is the "production" keychain?
I'm on an Intel-based Mac running macOS Sonoma 14.7.1 (23H222) and Xcode Version 16.1 (16B40).
I've created a local StoreKit Configuration File that does not synchronise with App Store Connect and selected it in the Scheme.
I have some products that are consumable in-app purchase and it loads fine as expected when I run the app and I am able to make transactions. It also show up in the Transaction Manager.
After a little while, working on the app, re-running it several times, it stops working. The products do not load the metadata from the StoreKit configuration file.
I also get this error in the console:
Error enumerating unfinished transactions for first transaction listener: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>, NSErrorFailingURLKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, NSUnderlyingError=0x60000038c150 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, _NSURLErrorNWPathKey_desc=satisfied (Path is satisfied), interface: lo0, _NSURLErrorNWResolutionReportKey_desc=Resolved 0 endpoints in 0ms using unknown from query}}, _kCFStreamErrorCodeKey=-72000}
Restarting the computer resolves the issue but I don't want to restart the computer every single time when it happens and it happens quite soon after a short while.
How can I make sure that it doesn't happen or if it does happen then fix the issue without restarting the computer?
Relaunching Xcode doesn't help and neither does deleting Project Build Data and Indexes.
I am having trouble submitting the next build of my macOS app to the App Store Connect. I keep getting a variation of this error:
ITMS-90238: Invalid Signature - The main app bundle MyApp at path MyApp.app has following signing error(s): code has no resources but signature indicates they must be present In subcomponent: MyApp.app/Contents/Frameworks/GoogleAppMeasurement.framework . Refer to the Code Signing and Application Sandboxing Guide at http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at https://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
ITMS-90238: Invalid Signature - The main app bundle MyApp at path MyApp.app has following signing error(s): code has no resources but signature indicates they must be present In subcomponent: MyApp.app/Contents/Frameworks/GoogleAppMeasurementIdentitySupport.framework . Refer to the Code Signing and Application Sandboxing Guide at http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at https://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
ITMS-90238: Invalid Signature - The main app bundle MyApp at path MyAppt.app has following signing error(s): code has no resources but signature indicates they must be present In subcomponent: MyApp.app/Contents/Frameworks/FirebaseAnalytics.framework . Refer to the Code Signing and Application Sandboxing Guide at http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at https://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
I am using Firebase framework as a Swift package. I tried updating Swift package to the latest version and that didn't help. I also tried to revert to the last version that was successfully used on the App Store/TestFlight and that didn't help.
I have no control over this framework other than not use it or choose a specific version.
I also tried to export the app and use the Transporter app and that didn't help.
Any suggestions?