Re: Values set in awakeFromInsert have gone missing.
Re: Values set in awakeFromInsert have gone missing.
- Subject: Re: Values set in awakeFromInsert have gone missing.
- From: "Marcus S. Zarra" <email@hidden>
- Date: Sun, 29 Jul 2007 18:45:31 -0600
On Jul 29, 2007, at 2:15 PM, Mike Zornek wrote:
I've encountered a strange bug while implementing AppleScript
support for my
Core Data app. The basic issue is values that are set in
awakeFromInsert
are present at one point but when I later get the object from the
MOC the
values aren't there. A more verbose demo is online:
http://mikezornek.com/temp/core_data_disapearing_values_bugs.mov
Any thoughts?
This looks like a threading issue. I am betting/guessing that
Applescript is coming in on its own thread and you are therefore
manipulating your MOC from more than one thread which we know is a
bad thing. I would test to see what thread you are on in that -init
method and check in the awakeFromInsert. If you are on another
thread the I would consider looking into moving this object
construction back onto the main thread.
Also, that -init method in your MOs scares me. Can you have a small
wrapper class that gets constructed ONLY from Applescript and it then
creates the MO instead of putting the -init method directly in the
MO? I would think that overriding the -init method cannot be a good
thing.
Anyway, those are my initial thoughts from your video. Nice idea on
doing a video btw, really makes it clear what the issue is.
Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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