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 11:39:26 -0700
From looking at the error's NSValidationErrorValue, it looks like
you're passing a set (specifically a Core Data relationship set) as
the value instead of an entityB instance.
If the relationship was really modeled as a 1:1 relationship, then you
need to do
[instanceOfA setValue:instanceOfB forKey:theKey]
Check that wherever you're coming up with instanceB that you're not
really getting an NSSet.
On Oct 14, 2007, at 12:02 PM, email@hidden wrote:
Message: 8
Date: Sun, 14 Oct 2007 11:19:54 +0200
From: "Hell's KItchen Hell's KItchen" <email@hidden>
Subject: Validation error in a relationship? (in coredata)
To: email@hidden
Message-ID:
<email@hidden>
Content-Type: text/plain; charset=ISO-8859-1
hello guys. I'm making a Core Data model. This model uses custom
NSManagedObject with some various methods. An entity have a
relationship 1:1 with the other. To set the releationship I've made
entity a setValue: entity_b forKey: mykey.
However when I save to the store I receive an error: mykey value
(entity b) is not valid (in entity A relationship destinatin is entity
b).
Why?
NSError "draft_content is not valid." Domain=NSCocoaErrorDomain
Code=1550 UserInfo={
NSLocalizedDescription = "draft_content is not valid.";
NSValidationErrorKey = "draft_content";
NSValidationErrorObject = <ANTStArticle: 0xd17dcc0> (entity:
DRAFT; id: 0xd1d8480
<x-coredata:///DRAFT/t36C100E1-1164-4967-AEE1-9BD60BFFDB73> ; data: {
"draft_connection" = 0;
"draft_content" = (0xd1e53e0
<x-coredata:///DRAFT_CONTENT/tC49CCDF8-28BF-42CB-A203-907129F9AA16>);
"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 = <_NSFaultingMutableSet: 0xd1dc630>
(<ANTStArticle_Content: 0xd1dce20> (entity: DRAFT_CONTENT; id:
0xd1e53e0 <x-coredata:///DRAFT_CONTENT/tC49CCDF8-28BF-42CB-A203-907129F9AA16
>
; data: {
"body_text" = kkkjkj;
"headers_data" = <040b7374 7265616d 74797065 6481e803 84014084
8484134e 534d7574 61626c65 44696374 696f6e61 72790084 840c4e53 4469>;
}));
}
_______________________________________________
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