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: Ron Lue-Sang <email@hidden>
- Date: Mon, 15 Oct 2007 14:02:03 -0700
On Oct 15, 2007, at 1:13 PM, dexter.cocoa dexter wrote:
Oh damn, I've tried to make a 1:n relationship to solve the previous
described problem. However I've a similar error with the 1:1 rel.
You can see it below, while this is my schema
(http://img100.imageshack.us/img100/5711/immagine1gr2.png) and this
the code for two used subclasses of nsmanagedobject if it can be
usefull... but it's a normal class (ANTStArticle:
http://paste.lisp.org/display/49214 - ANTStArticle_Content:
http://paste.lisp.org/display/49215)
-------METHOD
- (ANTStArticle_Content *) _getContentArchive {
ANTStArticle_Content *archive = [self
valueForKeyPath:STARTICLE_KEY_ARCHIVE];
if (archive == nil) {
archive = [[ANTStArticle_Content alloc] initWithEntity: [self
_getEntityFromBundle: @"DRAFT_CONTENT"]
insertIntoManagedObjectContext:[[NGSharedDrafts sharedDrafts]
managedObjectContext]];
[self setValue: archive forKey: STARTICLE_KEY_ARCHIVE];
}
return archive;
}
--------ERROR
NSError "draft_content is not valid." Domain=NSCocoaErrorDomain
Code=1550 UserInfo={
NSLocalizedDescription = "draft_content is not valid.";
NSValidationErrorKey = "draft_content";
NSValidationErrorObject = <ANTStArticle: 0xbc25f0> (entity: DRAFT;
id: 0xe1da250 <x-coredata:///DRAFT/t36F12C85-17FC-4C1E-BC84-D0D3490AD65A
>
; data: {
"draft_connection" = 0;
"draft_content" = 0xe1e6d20
<x-coredata:///DRAFT_CONTENT/t41A06899-D700-46E6-ABEE-6214CCB16700>;
"draft_isSentArticle" = 0;
"draft_isSuspended" = 0;
"draft_locked" = 0;
"draft_markAndSendNextTime" = nil;
"draft_messageID" = "<email@hidden>";
"draft_newsgroups" = nil;
"draft_profile" = 0;
"draft_replyToID" = nil;
"draft_sendLaterTime" = nil;
"draft_sentDate" = nil;
"draft_signName" = -1;
});
NSValidationErrorValue = <ANTStArticle_Content: 0xe1de780>
(entity: DRAFT_CONTENT; id: 0xe1e6d20
<x-coredata:///DRAFT_CONTENT/t41A06899-D700-46E6-ABEE-6214CCB16700> ;
data: {
"body_text" = fddfdf;
"headers_data" = <040b7374 7265616d 74797065 6481e803 84014084
8484134e 534d7574 61626c65 44696374 696f6e61 72790084 840c4e53 4469>;
});
}
Ok, this looks better. Still not sure what the problem might be. The
two things I'd check:
1) Does the source object have a validateDraft_Content:… method
returning NO?
2) Are both the source and destination objects in the same context?
Short of one of those two cases, I'd need to see the whole bt to
diagnose this.
Thanks
-----------------------------
Ronzilla
Core Bindings/Cocoa Builder/Interface Data
_______________________________________________
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