问题
I have an NSDocument
that contains a dataOfType
method, but it is not called when I do a save.
- (NSData *)dataOfType:(NSString *)typeName
error:(NSError *__autoreleasing *)outError
{
NSLog(@"db: %@", db);
return [NSKeyedArchiver archivedDataWithRootObject:db];
}
Why is this not called? Specifically, are there any reasons why my current document should not be the first responder that the menu-item "Save" points to?
回答1:
Did you leave 'Use Core Data' checkbox unchecked on create new project window?
来源:https://stackoverflow.com/questions/11311101/why-is-my-dataoftype-not-called-when-saving