• 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: Using an empty string as the default value for a Core Data attribute in the XCode modeller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller


  • Subject: Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller
  • From: Frank Reiff <email@hidden>
  • Date: Wed, 5 Sep 2007 17:44:21 +0200

Dear mmalc,

Modify the model immediately after reading it from disk.

Right, so if I modify the model programmatically when it first gets loaded, I can have a @"" default value without needing to sub-class NSManagedObject.. excellent.


I hadn't even suspected that you could programatically modify the model, but it should work fine:

Editing Models Programatically

Managed object models are editable until they are used by an object graph manager (a managed object context or a persistent store coordinator). This allows you to create or modify them dynamically. However, once a model is being used, it must not be changed. This is enforced at runtime—when the object manager first fetches data using a model, the whole of that model becomes uneditable. Any attempt to mutate a model or any of its sub-objects after that point causes an exception to be thrown. If you need to modify a model that is in use, create a copy, modify the copy, and then discard the objects with the old model.
Thanks for the tip.

Best regards,

Frank

On 5 Sep 2007, at 17:34, mmalc crawford wrote:


_______________________________________________

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


References: 
 >Using an empty string as the default value for a Core Data attribute in the XCode modeller (From: Frank Reiff <email@hidden>)
 >Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Nested binding question
  • Next by Date: Re: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
  • Previous by thread: Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller
  • Next by thread: CoreData - cannot load .sqlstore if path contains Alias folder
  • Index(es):
    • Date
    • Thread