Re: CoreData and arrays
Re: CoreData and arrays
- Subject: Re: CoreData and arrays
- From: John Timmer <email@hidden>
- Date: Tue, 07 Jun 2005 08:30:39 -0400
> If it is possible, how do I define an NSArray of NSString (or int or
> in fact anything?).
>
> The to-many relationship creates a heavyweight set of entities. I
> want an NSArray of things (be they simple types or custom classes).
> What I'm doing now is creating a to-many relationship from A to B,
> and putting these properties in B:
> stringValue - the value I want stored in the array element
> order - an int to order the array elements
> parent - the recommended back pointer.
>
> This is overly complicated for an array. I've no qualms about making
> a custom class and storing my array there with "old fashioned"
> bindings-style array accessors, if that's better.
You know, I felt exactly the same way when I set out to make my app. I got
things working nicely with an array being pulled into and out of a .plist
string. Then I tried seeing what happened when I tried to undo changes to
the array. The behavior was completely unpredictable.
Now, there clearly could have been an issue with some of my code, but the
conclusion I reached was that Core Data objects are set up to work properly
with other Core Data objects, and you avoid using them at your own risk.
JT
_______________________________________________
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