Loading/Saving Cocoa Objective C in NSDocument App
The file loads but the NSDatePicker doesn't change after I load it.
Here's my code...
Any thoughts?
/////////////////////////////////////////////////////////////
- (NSData *)dataRepresentationOfType:(NSString *)aType
{
NSDate* date = [datePicker dateValue];
return [NSKeyedArchiver archivedDataWithRootObject: date];
}
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
NSLog(@"About to read data of type %@", aType);
NSDate* date;
date = [NSKeyedUnarchiver unarchiveObjectWithData:data];
if(date == nil){
NSLog(@"Test");
return NO;
}
else{
[datePicker setDateValue: date];
return YES;
}
}
/////////////////////////////////////////////////////////////
PBook 17", Mac OS X (10.4.6)