I am writing an application in Cocoa that allows a user to export data in three different formats: CSV, JSON, and XML. I added the allowed extensions for the NSSavePanel:
NSSavePanel* saveFile = [NSSavePanel savePanel];
NSArray* extensions = [[NSArray alloc] initWithObjects:@"csv", @"json" @"xml", nil];
[saveFile setAllowedFileTypes:extensions];
However, how can I configure NSSavePanel so that the user can choose which format to save, for example, in TextEdit, where the "File format" list is offered? If possible, how can I determine which format was selected?
source
share