Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Just in case you're as new to XCode as me and want to try the snippets posted in Leandro's answerLeandro's answer:

  1. File->New->Project
  2. choose Command Line Tool as a project preset and name the project "cliinput"
  3. right-click in the project navigator (the blue panel on the left) and choose "New File..."
  4. In the drop down dialog name the file "UserInput". Uncheck the box "Also create a header file". Once you click "Next" you will be asked if XCode should create the Bridging-Header.h file for you. Choose "Yes".
  5. Copy & paste the code from Leandro's answer above. Once you click on the play button it should compile and run in the terminal, which in xcode is built-in in the bottom panel. If you enter a number in the terminal, a number will be returned.

Just in case you're as new to XCode as me and want to try the snippets posted in Leandro's answer:

  1. File->New->Project
  2. choose Command Line Tool as a project preset and name the project "cliinput"
  3. right-click in the project navigator (the blue panel on the left) and choose "New File..."
  4. In the drop down dialog name the file "UserInput". Uncheck the box "Also create a header file". Once you click "Next" you will be asked if XCode should create the Bridging-Header.h file for you. Choose "Yes".
  5. Copy & paste the code from Leandro's answer above. Once you click on the play button it should compile and run in the terminal, which in xcode is built-in in the bottom panel. If you enter a number in the terminal, a number will be returned.

Just in case you're as new to XCode as me and want to try the snippets posted in Leandro's answer:

  1. File->New->Project
  2. choose Command Line Tool as a project preset and name the project "cliinput"
  3. right-click in the project navigator (the blue panel on the left) and choose "New File..."
  4. In the drop down dialog name the file "UserInput". Uncheck the box "Also create a header file". Once you click "Next" you will be asked if XCode should create the Bridging-Header.h file for you. Choose "Yes".
  5. Copy & paste the code from Leandro's answer above. Once you click on the play button it should compile and run in the terminal, which in xcode is built-in in the bottom panel. If you enter a number in the terminal, a number will be returned.
Source Link
lukas83
  • 451
  • 6
  • 9

Just in case you're as new to XCode as me and want to try the snippets posted in Leandro's answer:

  1. File->New->Project
  2. choose Command Line Tool as a project preset and name the project "cliinput"
  3. right-click in the project navigator (the blue panel on the left) and choose "New File..."
  4. In the drop down dialog name the file "UserInput". Uncheck the box "Also create a header file". Once you click "Next" you will be asked if XCode should create the Bridging-Header.h file for you. Choose "Yes".
  5. Copy & paste the code from Leandro's answer above. Once you click on the play button it should compile and run in the terminal, which in xcode is built-in in the bottom panel. If you enter a number in the terminal, a number will be returned.