I am currently programming an application using glfw in MacOS X. My only problem is that the application doesn't use an AppDelegate, but does all the initialization in the main.cpp file like a command line utility. I specifically want to implement the function
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;
and I already registered the file extensions in the plist file and when I try to open them I get an error message saying "The document "Doc.xxx" could not be opened. MyApp cannot open files in the "xxx" format.
I attempted to create a singleton that sets itself as the delegate but it just doesn't call the function. Can anyone comment on the possibility of creating a class and implementing the NSApplicationDelegate functions?