Xcode 15: Core Data : No NSValueTransformer with class name *** was found for attribute YYY on entity ZZZ for custom `NSSecureUnarchiveFromDataTransformer`

Hi, I am creating a custom NSSecureUnarchiveFromDataTransformer in order to handle attributes of entities of type NSDateComponents. It all works and I did not see any warnings in the "Issue navigator" inside Xcode but with Xcode 15 I started seeing this warning:

/Users/.../CustomNSSecureUnarchiveFromDataTransformer/CoreData:1:1 no NSValueTransformer with class name 'CustomSecureUnarchiveFromDataTransformer' was found for attribute 'testDate' on entity 'Item'

My use case is very simple, I have this custom transformer:

@objc(CustomSecureUnarchiveFromDataTransformer)
final class CustomSecureUnarchiveFromDataTransformer: NSSecureUnarchiveFromDataTransformer {
    
    override class var allowedTopLevelClasses: [AnyClass] {
        return [NSDateComponents.self]
    }
    
    static let name = NSValueTransformerName(rawValue: String(describing: CustomSecureUnarchiveFromDataTransformer.self))
    
    public static func register() {
        let transformer = CustomSecureUnarchiveFromDataTransformer()
        ValueTransformer.setValueTransformer(transformer, forName: name)
    }
}

which is set to the Core data entity's "Transformer":

which leads to the warning in Xcode 15.

App works just fine and there are no problems during run time, but this warning is shown and I want to fix it.

Here is a simple test project https://github.com/VladimirAmiorkov/CustomNSSecureUnarchiveFromDataTransformer

Post not yet marked as solved Up vote post of Amiorkov Down vote post of Amiorkov
1.9k views

Replies

I'm also seeing this issue recently and cannot figure out why. Nothing has changed from my end, and everything works as expected.

  1. Transformable field in data model
  2. Correct class in the Transformer field
  3. Class is registered early in app lifecycle (in same class as Core Data container is created)
  4. Not using Swift Data
  5. Am using model versions in .xcdatamodel

It feels like an issue related to the analysis during build time.

I've submitted FB13311957.

  • To me it also looks like related to the analysis during build time only by the fact that this warning happens on a simple build with no run, which has nothing to do with run time life cycle events in which the custom transformer might be registered. I hope we will get some more info on this.

  • Please file a feedback. Perhaps reference this post and my FB number above.

  • I have submitted a Feedback via the Feedback assistant to the Xcode team. Will update as soon as I have a response.

Add a Comment

I too am seeing this warning since Xcode 15 with no changes regarding the ValueTransformer classes. Feedback filed - FB13317269

Same problem here, filed as FB13323831.

  • Same problem here, started with Xcode 15.

  • Same problem since Xcode 15, still an issue with Xcode 15.0.1 (15A507)

Add a Comment

My project is receiving the same set of warnings in this set up:

  • Sonoma (14.1).
  • Xcode 15.0.0 through Xcode 15.1.0 beta 3.

However, my project does not receive those warnings in this set up:

  • Ventura (13.6.1)
  • Xcode 15.0.0 through Xcode 15.1.0 beta 3.
  • Xcode 15.1 RC update:

    These warnings still show up when building against Xcode 15.1 RC on Sonoma (14.1).These warnings do not show up when building against Xcode 15.1 RC on Ventura (13.6.1).
  • Xcode 15.2 beta update: same issue as described above still exists.

  • Xcode 15.2 (final release) update: issue still exists. We treat all "warnings as errors", so this is frustrating. Our workaround now is to not upgrade to Sonoma (see note above)

Same thing here, filed as FB13448266

I have a workaround, but it clearly is a bug on Apple’s end.
I also filed a Feedback (FB13453227).

Did you received any update from Apple?

  • No response at all yet. My feedback still says "Similar Reports: None".

Add a Comment

Submitted as FB13514588.