One Quickie


Using an NSOpenPanel (General->General)
Using an NSOpenPanel with blocks:
- (IBAction) openEarthinizerDoc: (id) sender {
    NSOpenPanel *panel = [NSOpenPanel openPanel];

    [panel beginSheetModalForWindow: self.window
           completionHandler: ^(NSInteger result) {
            if (result == NSFileHandlingPanelOKButton) {
                NSURL *url = [[panel URLs] objectAtIndex: 0];
                [self openURL: url];
            }
        }];

} // openEarthinizerDoc



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com