• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSApplicationMain arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSApplicationMain arguments


  • Subject: NSApplicationMain arguments
  • From: email@hidden
  • Date: Sat, 12 Apr 2008 04:01:19 +0200

Hi,

I'm trying to add some launch arguments to my executable by modifying
the arguments passed to main.m, but find that the new arguments are
completely ignored. No matter what I pass to NSApplicationMain the
executable launches with the same old default argsv[]. Is this not the
right approach? Should I rather subclass NSApplication? If so, how?
Any help appreciated. Thanks.

int main(int argc, char *argv[])
{
        int new_argc = 2;
	char* arg1 = argv[0];
	char *new_argv[] = { arg1, "foo", "bar", NULL };

    return NSApplicationMain(new_argc,  (const char **) new_argv);
}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSApplicationMain arguments
      • From: Michael Vannorsdel <email@hidden>
    • Re: NSApplicationMain arguments
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: struct problem
  • Next by Date: Re: NSApplicationMain arguments
  • Previous by thread: Re: struct problem
  • Next by thread: Re: NSApplicationMain arguments
  • Index(es):
    • Date
    • Thread