Passing arguments to main function

xcode

Solution

For XCode < 4

In the Groups & Files section of the project, find "Executables". Find the executable that you're generating (i.e. "MyTestProject"), right click and select "Get Info". In the dialog that appears, there's an "Arguments" tab in which you can configure command line arguments and environment variables for launch. These command line arguments will be passed to "main".

For XCode >= 4

Select your scheme (it's the left hand side of the two part toolbar control listing your project and launch destination), and from the popup menu, choose to edit it. On the Run/Test/Profile targets, select the "Arguments" tab, and configure the arguments you want.

Problem

How to pass arguments to the main function in XCode ? Thanks

Original source