• 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 14:31:20 +0200

Hi Annard,

Why don't you just subclass NSManagedObject for this entity and set this value explicitly to an empty string when a new instance is created using -awakeFromInsert?

Yes, I could do that but I was hoping to avoid creating subclasses for each and every class that takes an empty string as a default value.. I'm using Core Data as a database rather than as an persistent object model, so if there is any way of avoiding doing this programatically it would really help me out..


Up to now I was using custom classes and a simple XML storage format in conjunction with Cocoa bindings to get a quick and effective way of "remembering" UI settings that are too complicated for NSUserDefaults. This is kind of cool because I can take the settings and store them into droplets, share them over the internet, etc..

For my latest project I'm using Core Data for overcoming Cocoa's memory management limitations with very large data sets (instead of mucking around with NSAutorelease pools and profiler tools). With this solution even the machine's RAM is no longer a hard limit..

I was quite happy with those developments and given how well Core Data and Cocoa Bindings seemed to be integrated I thought this might be an opportunity to get rid of my custom bindings code and make use of the built-in modelers and validation support.. unfortunately once I start having to subclass everything, I'm stuck with the same overhead as before and with more constraints + Apple bugs rather than my own custom bugs which I prefer ;-)

I'm not keen on having to import the class definitions into each nib that uses them, writing boiler-plate initialization code, source manage them, etc..

Still I'm only starting to learn about Core Data and while it looked like a solution to everything, learning more about its limits early on might not be a bad thing.. there's still time to ditch it for what it's no good at and keep it for where it makes sense.

I take it that there simply isn't any way then to put an empty string as a default value in the modeler? Sigh..

Thanks for your help.

Best regards,

Frank
_______________________________________________

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: email@hidden)

  • Prev by Date: Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller
  • Next by Date: Re: Attributed Strings in Distributed Objects
  • Previous by thread: Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller
  • Next by thread: Re: Using an empty string as the default value for a Core Data attribute in the XCode modeller
  • Index(es):
    • Date
    • Thread