• 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
Simple Value Expressions in a Core Data Mapping Model?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Value Expressions in a Core Data Mapping Model?


  • Subject: Simple Value Expressions in a Core Data Mapping Model?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 04 Jan 2013 15:28:31 -0800

I needed to create a Core Data Mapping Model today.  The only value migration necessary was to negate a boolean.  It seems like one should be able to enter such a simple expression into the "Value Expression" column of "Attribute Mappings".  Reading the Predicate Programming Guide, I tried, in turn, these three…

   !$source.foo

   NOT $source.foo

   NOT($source.foo)

However, in each case, Xcode complained of an invalid expression.  At that point I gave up and did the only thing I know that works, which is to subclass NSMigrationPolicy, implement a method that negates a given NSNumber, and reference it in the expression…

    FUNCTION($entityPolicy, "negateBoolean:" , $source.foo)

It tested OK and is ready to ship.  But, for next time, is there an easier way to do this?

Thanks,

Jerry
_______________________________________________

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: Re: [BUG SUBMITTED] Text Field Cells in Table View: Enabled and Editable not working
  • Next by Date: Re: scroll bars and visible rect
  • Previous by thread: Re: Optimal height for WebView
  • Next by thread: NSCalendar week-of-year calculations and week 1
  • Index(es):
    • Date
    • Thread