BitSensei

programmer knowledge

  • Increase font size
  • Default font size
  • Decrease font size
Home Languages Objective C The Minimal Code to Create an Open File Dialog in Cocoa

The Minimal Code to Create an Open File Dialog in Cocoa

E-mail Print PDF

The following gives a minimal code necessary to create and use an NSOpenPanel modal file open dialog box in Objective C

 
    NSOpenPanel *op = [NSOpenPanel openPanel];
    if ([op runModal] == NSOKButton)
    {
        NSString *filename = [op filename];
 
    }
 
Last Updated on Monday, 18 May 2009 18:24