I've trying to use a folder browser dialog in my application. However, the
application crashes after the dialog has been opened anywhere between 1 and 5
times. Is the code I'm using correct?
[ObjectiveCMessage("browseForDatabaseFolderPath:")]public void
BrowseForDatabaseFolderPath(){ const int DIALOG_HEIGHT = 400; const int
DIALOG_WIDTH = 600; NSOpenPanel openPanel =
NSOpenPanel.OpenPanel; openPanel.CanChooseDirectories
= true; openPanel.CanChooseFiles = false;
openPanel.SetContentSize(new NSSize(DIALOG_WIDTH, DIALOG_HEIGHT));
int dialogResult = openPanel.RunModal();
if (dialogResult == NSPanel.NSOKButton) { // OK.
} else { // Cancel. }}