• 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
Core Data Versioning: Non-trivial Value Expressions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data Versioning: Non-trivial Value Expressions?


  • Subject: Core Data Versioning: Non-trivial Value Expressions?
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 3 May 2010 18:53:36 -0700

When doing Core Data versioning, when creating a Mapping Model, when writing Custom Value Expressions, I understand that the syntax to be used is that described in the Predicate Programming Guide > Predicate Format String Syntax.

But I can't figure out how to do non-trivial mappings like these...

Example 1:  Old data model attribute type is an Integer16.  I want to map this to a Boolean which is NO if the old value was 0 and YES if != 0.

Example 2:  Old and new data model attribute types are both String.  If the string is "Joe", I want to map it to "Jose"; else, map the original value.

It seems like the concept of "mapping" should support stuff like this, but I can't find any such examples.  In MigratingDepartmentAndEmployees, all I see is mapping from one attribute name to another.

Relations get a complicated expression like this generated automatically:

FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "EmployeeToEmployee", $source.employees)

but I have no idea where that FUNCTION keyword comes from (it's not listed as a reserved word in the Predicate Programming Guide).  It seems like I should be able to make my own FUNCTION to implement the stuff I need in my examples.  Is this possible?

Thanks,

Jerry Krinock

_______________________________________________

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

  • Follow-Ups:
    • Re: Core Data Versioning: Non-trivial Value Expressions?
      • From: Chaitanya Pandit <email@hidden>
  • Prev by Date: Undo Action Message
  • Next by Date: Re: Undo Action Message
  • Previous by thread: Re: Undo Action Message
  • Next by thread: Re: Core Data Versioning: Non-trivial Value Expressions?
  • Index(es):
    • Date
    • Thread