How to Run Objective-C code in Xcode?

Steps to run Objective-C code in Xcode:

1. Start the Xcode application.

2. If this is a new project, select File, New, Project or choose to Create a New Xcode Project from the startup screen.

3. For the type of application, select Application, Command Line Tool, and click Next.

4. Select a name for your application and set its Type to Foundation. Fill in the other fields that appear on the sheet. Click Next.

5. Select a name for your project folder and a directory to store your project files in. Click Create.

6. In the left pane, you will see the file main.m. Highlight that file. Type your program into the edit window that appears in the rightmost pane.

7. On the toolbar, select the middle icon in the upper-right corner to reveal the debug area. That’s where you’ll see your output.

8. Build and run your application by clicking the Play button on the toolbar or selecting Run from the Product menu.

9. If you get any compiler errors or the output is not what you expected, make your changes to the program and re-run it.