Access original argc and argv from application delegate willFinishLaunchingWithOptions. How?

Hello all!

Need to get access to the parameters of main function from application delegate method "willFinishLaunchingWithOptions". How it could be?

Fond in ProcessInfo this functionality:

NSArray* oArguments = [[NSProcessInfo processInfo] arguments];

But how to get original int argc and const char* argv[]? Or how to convert NSArray* to const char* argv[]?

There’s a couple of ways you can do this:

  • You can modify main.m to stash away these values somewhere that your app delegate can access them.

  • You can call _NSGetArgv and _NSGetArgc from <crt_externs.h>.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Access original argc and argv from application delegate willFinishLaunchingWithOptions. How?
 
 
Q