
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.70 KB | hits: 13 | expires: Never
How to use NSWorkspace to be able to open a filetype? - Cocoa
#import <Cocoa/Cocoa.h>
@interface fileClickerAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
NSTextField *fileName;
}
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSTextField *fileName;
@end
#import "fileClickerAppDelegate.h"
@implementation fileClickerAppDelegate
@synthesize window;
@synthesize fileName;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
}
- (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames {
[fileName setStringValue:[NSString stringWithFormat:@"Wow, even multiple files like %d :-)", [filenames count]]];
}
@end