• 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
Re: cocoa and argv
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa and argv


  • Subject: Re: cocoa and argv
  • From: Brian Ling <email@hidden>
  • Date: Thu, 15 Aug 2002 03:36:58 -0700 (PDT)

I tried putting

char *testvar; //above the main function
testvar = argv[1]; //in the main function

however if i tried to access testvar in my controller
actions I get &#34;testvar undeclared&#34;.

what have I missed.
&gt;
&gt; Save the contents of the array in a global
variable,
&gt; which can be accessed
&gt; from anywhere.
&gt;
&gt; / David
&gt;
&gt; &gt; Hi,
&gt; &gt;
&gt; &gt; I seem to have a slight problem, I need to
open a
&gt; &gt; cocoa app from the command line, with an
argument.
&gt; &gt; When the app is open by:
&gt; &gt; myapp.app/Contents/MacOS/myapp argument
&gt; &gt;
&gt; &gt; I can access argv from the main.m main
function.
&gt; &gt; The problem is how can I access argv from my
&gt; &gt; Controller class?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
_______________________________________________
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.

  • Follow-Ups:
    • Re: cocoa and argv
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re: cocoa and argv
  • Next by Date: Re: cocoa and argv
  • Previous by thread: Re: cocoa and argv
  • Next by thread: Re: cocoa and argv
  • Index(es):
    • Date
    • Thread