Product -> Edit Scheme
Click on "Run" in the left-side part of the dialog box. If needed, switch to "Arguments" tab in the middle part of the dialog box. Under "Arguments Passed On Launch", press "+" and add a value. Then you can access the value using the following code:
NSProcessInfo *proc = [NSProcessInfo processInfo]; NSArray *args = [proc arguments]; NSString *myArg = [args objectAtPosition: 1];
One note worth mentioning: if your argument contains spaces, enclose it in quotes: "my argument".
No comments:
Post a Comment