Re: CoreData Best Practices
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