Almost same to this issue.
I'm creating a new document based application for OS X Lion.
This document says, I must override dataOfType:error:
and readFromData:ofType:error:
in a subclass of NSDocument to read / write files, so I added these methods in my document class but they were never called when I selected Open or Save menu items.
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError {
NSLog(@"Read from data");
return NO;
}
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError {
NSLog(@"data of type");
return [NSData data];
}
I also tried to override writeToFile:ofType:
and readFromFile:ofType
but they also never got called.
These methods were called when I created document based applications in Snow Leopard.
Why these methods are not get called?