• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPredicate: Using NSExpression CAST(x, 'Class') is deprecated and will be removed in a future release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPredicate: Using NSExpression CAST(x, 'Class') is deprecated and will be removed in a future release


  • Subject: Re: NSPredicate: Using NSExpression CAST(x, 'Class') is deprecated and will be removed in a future release
  • From: Sean McBride via Cocoa-dev <email@hidden>
  • Date: Wed, 16 Mar 2022 19:31:13 -0400

On 18 Nov 2021, at 19:44, Sean McBride via Cocoa-dev wrote:

> Hi all,
>
> Starting in Monterey, I see a new message logged by Core Data during
> persistent store migration:
>
> NSPredicate: Using NSExpression CAST(x,'Class') is deprecated and will be
> removed in a future release. 'MyClassName' should not be cast into a Class
> object.'
>
> This is due to my .xcmapping model where I set an attribute mapping to:
>
> FUNCTION(CAST("MyClassName", "Class"), "myMethodName:",
> $source.myOldAttributeName)
>
> If this isn't correct, how can I invoke a custom method to transform an old
> attribute into something new?

In case it helps anyone, my solution was to create an NSMigrationManager
category and put my custom methods in there and then set the attribute mapping
to this instead:

FUNCTION($manager, "myMethodName:", $source.myOldAttributeName)

Sean
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: New (?) behavior of screensavers wrt. keyboard clicks
  • Next by Date: Re: New (?) behavior of screensavers wrt. keyboard clicks
  • Previous by thread: Re: New (?) behavior of screensavers wrt. keyboard clicks
  • Next by thread: Is a HUD panel supposed to be translucent?
  • Index(es):
    • Date
    • Thread