Re: Validation error in a relationship? (in coredata)
Re: Validation error in a relationship? (in coredata)
- Subject: Re: Validation error in a relationship? (in coredata)
- From: Jim Correia <email@hidden>
- Date: Wed, 17 Oct 2007 00:07:44 -0400
On Oct 16, 2007, at 7:58 PM, Chris Hanson wrote:
Your code is still incorrect. Just looking at <http://pastebin.com/
m38aa3280>...
(1) Your -setMessageBody: method is not using the *change*
notification methods, it is using the *access* notification
methods. This is incorrect.
(2) Your -messageBody: method is not using the access notification
methods, it is just returning the result of -
primitiveValueForKey:. This is incorrect.
You have similar errors in the rest of your code, at least from
looking at <http://pastebin.com/m65f42c4b>. I strongly recommend
reading up a bit more on how to write Core Data accessors and
ensuring the correctness of your code with respect to the Core Data
documentation. I suspect that will help resolve the problem in
your code a lot more quickly, and help prevent more problems of
this kind from cropping up.
After reading and understanding the docs, it may also be a good idea
to just use
Copy Method Declarations to Clipboard
Copy Method Implementations to Clipboard
from the data modeler and use the generated methods/delcarations as a
starting point to which you can add any necessary customizations.
That will prevent inadvertent use of will/didAccessValueForKey when
you should have been using will/didChangeValueForKey.
Jim
_______________________________________________
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