Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Data Save Error (NSValidationErrorKey, Cocoa error 1570) saving NSDate
    text
    copied!<p>I'm getting an error with saving to a Core data object in Xcode.</p> <p>Xcode says that the error is in the NSDate variable 'datum' but I have tried almost everything. Error is:</p> <pre><code>2011-07-12 18:01:29.068 WeekLijstje[3205:207] Core Data Save Error NSValidationErrorKey datum NSValidationErrorPredicate (null) NSValidationErrorObject &lt;DagLijst: 0x6e2fcd0&gt; (entity: DagLijst; id: 0x6e2fd30 &lt;x-coredata:///DagLijst/t99F423FC-AAE9-4692-9264-EF0FF7A020572&gt; ; data: { Voedsel = nil; datum = nil; hoeveelheid = 0; punten = 0; }) NSLocalizedDescription:The operation couldn’t be completed. (Cocoa error 1570.) </code></pre> <p>A small code snipet:</p> <pre><code> DagLijst *newDaglijst = [NSEntityDescription insertNewObjectForEntityForName:@"DagLijst" inManagedObjectContext:self.managedObjectContext]; NSDate *selDatum = [NSDate date]; newDaglijst.punten = [NSNumber numberWithInteger:10]; newDaglijst.hoeveelheid = [NSNumber numberWithInt:100]; newDaglijst.Voedsel = geselecteerdVoedsel; newDaglijst.datum = selDatum; NSError *error = nil; if (![newDaglijst.managedObjectContext save:&amp;error]) { ... </code></pre> <p>Also the class of the DagLijst object:</p> <pre><code>@interface DagLijst : NSManagedObject { @private } @property (nonatomic, retain) NSDate * datum; @property (nonatomic, retain) NSNumber * punten; @property (nonatomic, retain) NSNumber * hoeveelheid; @property (nonatomic, retain) Voedsel *Voedsel; @end </code></pre> <p>So you can see that I put an NSDate into the 'datum' variable. But on execution I still get an error.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload