My application has a custom format for which it is registered in Info.plist as being an editor and can read and write to that format. It can also read a number of other formats, but cannot write to them. For these formats it is registered in Info.plist as being a viewer.
When I open one of the other formats, everything seems fine, but when I come to save the file my NSDocument is sent the message writeToURL:ofType:error:
with the URL of the file I loaded and the type as the UTI of the format I cannot write.
-(NSArray *)writableTypes
only returns my custom format's UTI, and -(BOOL)isNativeType:
only returns YES for my custom format's UTI.
What I'd like to do is, like other applications that have a native format but can read from other formats, when the user presses Save, the save panel is opened and the user selects a filename in which to save as the native type.
Is this something that NSDocument can do itself, or do I need to check in writeToURL:ofType:error:
to see if I need to open the save panel manually?