• 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: CoreData Best Practices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData Best Practices


  • Subject: Re: CoreData Best Practices
  • From: John Timmer <email@hidden>
  • Date: Fri, 29 Apr 2005 16:34:23 -0400

If you decide you absolutely need an array of strings, there's a way to do
it:

Subclass NSManagedObject and add an array ivar
Make array retrieve/add/delete methods
Have keyed value that's a string or data

When the array changes, have it save its string representation or coded data
to the keyed value.  If the array is requested when its ivar is nil, use
simply re-create it from the keyed value.

There's going to be a problem with large arrays, so this might be painfully
slow with the human genome publication, but it's fine for most instances.

JT


> I'd like some advice on the best way to use CoreData in various
> situations.  I'm trying to create a BibTeX manager.  The problem I'm
> facing is that BibTeX allows user defined fields and multiple
> authors.  The obvious way to handle this is to store multiple authors
> as an NSArray of NSStrings and the user defined fields in an
> NSDictionary.  However, these type aren't available as attributes in
> CoreData.  The best way I can think of to overcome this is to
> serialize dictionaries and arrays and store them as data attributes.
> This doesn't seem to be a solution and I wondered if anyone else had
> a better one.
>
> Thanks,
> ~Jim

_______________________________________________
This mind intentionally left blank


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CoreData Best Practices
      • From: Bill Bumgarner <email@hidden>
    • Re: CoreData Best Practices
      • From: John Timmer <email@hidden>
References: 
 >CoreData Best Practices (From: James Clause <email@hidden>)

  • Prev by Date: Re: CoreData retain/release/delete
  • Next by Date: Re: Breaking into debugger after program hangs....
  • Previous by thread: Re: CoreData Best Practices
  • Next by thread: Re: CoreData Best Practices
  • Index(es):
    • Date
    • Thread