Error in Awake From Insert Method


#1

I got the following error when the program executes the awakeFromInsert method.

-(void)awakeFromInsert{
    
    [super awakeFromInsert];
   [self setDateCreated:[NSDate date]];
}

“2012-02-08 09:47:41.587 Homepwner[1864:b603] Adding after 0 items, order = 1.00
2012-02-08 09:47:41.593 Homepwner[1864:b603] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Unacceptable type of value for attribute: property = “dateCreated”; desired type = NSNumber; given type = __NSDate; value = 2012-02-08 14:47:41 +0000.’”

In the Possession.m I set “@property (nonatomic, retain) NSDate * dateCreated;”

Any suggestions where I might screwed up ?


#2

I had this same problem, and all I did was change the dateCreated type to date in the .xcdatamodeld file