I have a simple document-based Cocoa application that acts as a viewer for .wav files to analyze the frequency a bit. I would like to be able to export data obtained from open files to CSV for further analysis in other programs.
Cocoa's document-based application framework allows you to override
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
to implement the default workflow Save / Save As ..., but I do not want to write the files that I open.
The obvious thing to do is implement the export workflow in my document, submit a file save sheet, create some NSData and write it to the file path, but there is no obvious way to connect the outlet in MainMenu nib to the action on the document controller.
So, what is an acceptable way to implement such functionality in a Cocoa document-based application?
source
share