Introduction
In this article we create a single-view application. Here we use one label and three buttons using xib (XCode Interface Builder). In this app, when we click on the first button, the button title color changes and it shows text in the label. The same happens when we click on the second button; the button title color changes and it shows other text in the label, as it is when we click on third button, where again the button title color changes and it shows other text on the label.
Step 1
Open XCode by double-clicking on it.

Step 2
Create a New XCode Project via clicking on it.

Step 3
Now select "Single View Application" and click on Next.

Step 4
Now give your Product Name. Here I use UIView and Company Identifier Mcn Solutions and click on Next.

Step 5
Select the location where you want to save your project and click on Create.

Step 6
Now you will see in the XCode Window six Objective C Classes generated by XCode. When we use a Single View Application, ViewController automatically generate ViewController.h, ViewController.m class or xib correspondence to iPhone/iPad.
1.Appdelegate.h
2.AppDelegate.m
3.ViewController.h
4.ViewController.m
5.ViewController_iPhone.Xib
6.ViewContoller_iPad.Xib.
Here we write code only in the View Controller class.
ViewController.h

ViewController.m

ViewController_iPhone.Xib

ViewContoller_iPad.Xib

Step 7
Click on the File owner icon

Step 8
Connect the button to it's object via linking

As it is done for iPad:

Select action touch up inside

Select which platform you want to see the output for.

Output
Output 1 in iPhone:

Output 2 in iPhone:

Output 3 in iPhone:

Output 4 in iPhone:

Output 1 in iPad:

Output 2 in iPad:

Output 3 in iPad:

Output 4 in iPad:


kamal bhattPosted Jun 16, 2017, 1:26 AM
Can anyone help me to solve this issue , I have 100 text files and 100 buttons, I want if i click button 1 the text file 1 will be printed on label in view controller , is it possible and if possible then how can i do this?
Sowji ProjectsPosted Oct 21, 2015, 4:57 AM
can any one help how to add dynamic labels on scroll view on entering text in textfield
Sowji ProjectsPosted Oct 21, 2015, 4:57 AM
add dynamic labels on scroll view on entering text in textfield
karthi keyanPosted Feb 18, 2014, 1:20 AM
it is easy to learn...awesome man!!thank you guys.....
Sachin BhardwajPosted Oct 26, 2012, 7:11 AM
ok, In iPhone technology we use popupviewcontroller in place of drop down list. very early i will explain it via article. thanks for comment...
Shivam PandyaPosted Oct 24, 2012, 1:01 AM
Nice article, Can you tell me how to make a toolbar in IPAD apps and I also want to know that how can I implement "On touch" or something like that events. I want to know that how can i open drop down list box when i click on any of one tool bar's button.