Re: Finding managed objects by URI representation
Re: Finding managed objects by URI representation
- Subject: Re: Finding managed objects by URI representation
- From: Gideon King <email@hidden>
- Date: Tue, 6 Apr 2010 10:31:46 +1000
You know you might just be right. The core problem was that I was using the value that I had generated as my reference object, because of my lack of understanding about it needing to be consistent for a particular managed object, but different for different objects (even if they had been loaded from the same store). And then I thought the managed object IDs were unique identifiers, but now understand that they change between creation and storage, and are therefore not like primary keys.
So maybe I overreacted to take my identifiers out altogether. I could move my managed object ID to a different attribute in my store, and have my own id written out when I need to, and when I need to store and load relationships, just do them via the IDs. and not the managed object IDs.
Sometimes it's difficult to see the woods from the trees.
Thanks
Gideon
On 06/04/2010, at 10:00 AM, Sean McBride wrote:
> On Sun, 4 Apr 2010 23:14:20 +1000, Gideon King said:
>
>> I have some queries that used to look up objects based on an elementID
>> attribute, which used to be my unique identifier for objects, created
>> when the objects were inserted or loaded.
>
> I use this pattern also.
>
>> I am now moving away from that
>> and using the standard managed object IDs and reference objects.
>
> Why? All the reasons you and Ben have been discussing is exactly why I
> find it much easier to just have my own unique identifier. The
> downsides are: 1) takes a little more space in the store (and on disk
> and in RAM) 2) is slower to fetch against vs using the permanent
> NSManagedObjectID. I'm curious why you are switching. I have thought
> about doing the same, but it just seems like way more work for little benefit.
_______________________________________________
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