What are argc and argv from Finder (was "Voodoo...")
What are argc and argv from Finder (was "Voodoo...")
- Subject: What are argc and argv from Finder (was "Voodoo...")
- From: Jerry Krinock <email@hidden>
- Date: Sun, 29 Feb 2004 12:20:09 -0800
The "voodoo" I reported yesterday is related to my having added some
command-line arguments to my application. It looks like the Finder is
sending some command-line arguments which are confusing my argument parser.
In the following well-known function...
int main(int argc, const char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
return NSApplicationMain(argc, argv);
}
someone is maing a point of passing argc and argv through to
NSApplicationMain. However, in document
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC
_classic/Classes/NSApplication.html
it says that NSApplicationMain(argc, argv) is "functionally similar to":
void NSApplicationMain(int argc, char *argv[]) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"myMain" owner:app];
[NSApp run];
}
which as as you can see it does not use argc or argv.
So, I'd like to know: What values of argc and argv does the Finder pass to
applications on the command line?
(Also, does anyone know a trick for writing things to console.app when an
application is launched from the Finder? You know, NSLog() to the
terminal.app won't work if I don't launch the app from terminal.app. If I
could write out argc and argv, I could quickly answer the question myself!)
Jerry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.