Why is my dataOfType: not called when saving?

给你一囗甜甜゛ 提交于 2019-12-11 18:48:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!