Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Strange (as for me) behavior or bug with saving #174

Closed
yas375 opened this Issue Jun 4, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

yas375 commented Jun 4, 2012

In my app I'm trying to create new photo and associate it with existent category. And after that I'm trying to fetch all other photos, not in this category.

The problem is that I got this new and just added to category photo also in this list. But photo already in this category and after application restart it will not be able in this request.

So at first it seems that something is not saving, but I'm saving context after photo creation and after adding photo to category too. And I tried to save with save and saveNestedContexts but nothing changed.

So, I've created simple app with just needed staff to reproduce this error. Here's it is: https://github.com/yas375/MagicalRecordPayload/

Test code in AppDelegate: https://github.com/yas375/MagicalRecordPayload/blob/master/MagicalRecordPayload/MRPAppDelegate.m#L24

And here is a little screencast which is demonstrates this strange behavior: http://screencast.com/t/GW487aJl03b

One more thing to pay attention: object ids of already created photos are like:

<x-coredata://03169FD4-734F-4468-BD9F-743354E0FCCB/Photo/p1>
<x-coredata://03169FD4-734F-4468-BD9F-743354E0FCCB/Photo/p2>
<x-coredata://03169FD4-734F-4468-BD9F-743354E0FCCB/Photo/p3>
<x-coredata://03169FD4-734F-4468-BD9F-743354E0FCCB/Photo/p4>

but new photo which I've just created and already saved has next kind of objectid: <x-coredata:///Photo/t3CF2DEA9-7237-4126-B414-DC2148FC3ACB2>. But after restarting the application photos' objectID changed to usual format.

What's wrong?

thanks in advance

Contributor

yas375 commented Jun 4, 2012

if it will be acceped as a bug than I could try write a test for this. I already looked at tests in magical record and this task seems interesting and possible for me)

Contributor

yas375 commented Jun 6, 2012

I've downgraded MagicalRecord to 1.8.3 version in my test app and it is working!! I've commited it as separate branch So the issue occurs with MagicalRecrd 2.0.3

@blackgold9 blackgold9 closed this Oct 9, 2012

Contributor

yas375 commented Oct 15, 2012

I've also just retested it with the latest version of MagicalRecord and the issue is gone =)
thanks everyone)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment