As it should Xcode sets up the main function in main.m as follows:
Perhaps this is a stupid question but the answer is really not obvious to me. How do I get the values in argc and argv from within my classes?
argc should be 1, at least, and argv[0] should be the parth to my program. And within main in main.m that is easily verified. But how do I read them later?
Also, how do I define a method that runs when the program starts? I can press a button and make a method do something, but how can I get a method to run without having the user do anything to create an event?
Code:
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}
Perhaps this is a stupid question but the answer is really not obvious to me. How do I get the values in argc and argv from within my classes?
argc should be 1, at least, and argv[0] should be the parth to my program. And within main in main.m that is easily verified. But how do I read them later?
Also, how do I define a method that runs when the program starts? I can press a button and make a method do something, but how can I get a method to run without having the user do anything to create an event?