Getting Started with iOS with UI Elements (Objective-C)
By: Luis A. Sierra
Creating the Hello World iOS App Project![]()
Hello, World! It is the first basic program in any programming language. Let's write the first program in the iOS with Objective-C programming language.
To create and run a hello world program follow the following steps:
Step 1: Open XCode in your system and Create a new XCode project.
Step 2: Select the App and then click on the Next button.
Step 3: Give a name to your project like here we give "helloworld" and then click on next button.
Step 4: Select the project location and then click on the create button. Now the project is created.
Step 5: Now open Main.storyboard file in the project navigator.
OPTION 1: Create the UILabel (with Storyboard)
8.1 Hold down Ctrl, click the UILabel, and drag it inside ViewController.h.
8.4 Your ViewController.h should look like this:
Step 9: Now let go to add the HelloWorld code to the msg UILabel:
OPTION 2: Create the UILabel by code (without Storyboard)
Start from Step 4 and go to ViewController.m and add the code below:
This is useful if you want more control or are working without Storyboard/XIBs.
Step 10: Now let run our app iOS with Objective-C:
Post a Comment