CoreData doesn't import the data when using dictionaries in a transformable core data attribute. I'll attach screenshots of the setup and the project. Using a custom NSSecureUnarchiveFromData like [String] works but Dictionary<String: String> does not work. Dictionaries worked perfectly under iOS16 and previous versions. I've been having this issue for a while. I'm currently testing under the Xcode15 RC, but the problem was also with earlier versions. The error warning is: 69.635 HALC_ProxyIOContext.cpp:1.329 HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload. The error occurs similarly for two entries as it occurs for 1000 entries. The reason is the Dictionary in the transformable.
The issue occurs only in combination with using a Dictionary in an NSBatchInsert request as transformable. Unfortunately, it is necessary to keep this configuration for me because older users have their data stored in that format. Creating the ManagedObjects like Object(context: ...) works but is way to slow for big datasets.
Here is a demo project to reproduce the bug: https://github.com/NilsBerni/NSBatchInsertIos17Bug



The issue you are facing with NSBatchInsert and transformable attributes, specifically with dictionaries, is a known bug in iOS 17 (Xcode 15). This bug causes NSBatchInsert to fail when trying to import data with dictionaries as transformable attributes.
Unfortunately, there is no direct workaround for this bug. However, there are a few alternative approaches you can consider:
Use a different data type: Instead of using a dictionary, you can consider using other data types that are supported by Core Data, such as NSData or NSSet. You can serialize your dictionary into NSData before saving it to the transformable attribute.
Split the dictionary into separate attributes: If possible, you can split the dictionary into separate attributes in your Core Data model. For example, if your dictionary has keys "key1" and "key2", you can create two separate attributes in your entity, "attribute1" and "attribute2", and store the corresponding values from the dictionary in these attributes.
Use a separate entity: Instead of using a transformable attribute, you can create a separate entity to represent the dictionary. This entity can have two attributes, "key" and "value", and you can create a to-many relationship between your main entity and this dictionary entity. This way, you can store each key-value pair as a separate object.
Wait for a bug fix: You can keep an eye on Apple's bug tracker and developer forums for any updates on this issue. It's possible that Apple will address this bug in a future release of iOS.
In the meantime, if performance is a concern for importing large datasets, you can consider using other methods like NSBatchUpdateRequest or importing the data in smaller batches using multiple NSBatchInsert requests.
It's also worth mentioning that you can provide feedback to Apple through the Feedback Assistant link you shared. This can help bring attention to the issue and increase the chances of it being addressed in a future update.
So good luck!