Kind of related, but adding this in case it is useful to someone:
If you just want to process any file dragged onto the application icon (itβs not necessary to be a document-based application):
In .h:
- (void)application:(NSApplication *)sender openFiles:(NSArray *) fileNames;
In .m:
- (void)application:(NSApplication *)sender openFiles:(NSArray *) fileNames { NSLog(@"Files dragged on: %@", fileNames); }
In your xxx.plist, create a new entry in CFBundleDocumentTypes:
<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>*</string> </array> <key>CFBundleTypeName</key> <string>NSFilenamesPboardType</string> <key>CFBundleTypeRole</key> <string>None</string> </dict> </array>
glassfish
source share