본문 바로가기

개발관련/Mac

using NSOpenPanel

NSOpnPanel *panel = [NSOpenPanel openPanel];

NSArray *fileTypes = [[NSArray alloc] initWithObjects:@"txt", @"doc",,,nil];
[panel setAllowedFileTypes:fileTypes];
if ( NSOKButton == [panel runModal] )
{
    // do work
}

reference

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenPanel_Class/Reference/Reference.html