So today we are going to create step by step simple Hello World application for iPhone
(simplest program in iPhone ever)
while on my system iOS sdk 5.0 and XCode 4.2 IDE is already installed if you want to look at installation and How to start XCode then check my earlier post here..
okay let's begin..
Go to File Menu >> New >> New Project
or press (Shift+Windows/Command Button+N) on keyboard..
select "Single View Application"
Now put some text..
Product Name : HelloWorld
Company Identifier (package name) : com.soft
Device Family : iPhone (set)
finally UN-check options 'Use Storyboard' & 'Include Unit Tests' like this..
select the location mine is Desktop (just for this Tutorial) but
Please Don't save your project on Desktop or My Document, just save in Another Hard Drive (Except Operating System installed Hard Drive)
so here is First look of your application..
now i am going to define the Project Structure and brief information about important files..
# Header File (.h)
# Implementation File (.m)
# XML Interface Builder File (.xib)
# Main File (.m) [it's like main method in C language]
here are these file in our project..
Header File :
Objective-C Header files. Header files contain class, type, function, and constant declarations.
Default look of Header file is like this
Implementation/Source File
The implementation file contains the actual code for the methods of the class we have defined in header file.
Default look of Implementation file is like this
Default look of XIB file is like this
So now we will add Label to show "Hello World" message in our project
1. open XIB file
2. show Utility (Click on Top-Right Tab)
3. show Object Library (on Bottom -Right Panel)
4. Drag UILabel to View..
like i have shown in image ..
set 'Hello World' message on label
now save project (press Windows/Command button+S)..
its time to execute our project do like this image (press Command+R)
The output Screen will be look like this..
ye hip hip hureeee... we did it.. so this is Hello World in iPhone..
if you want to know some advance Control then go here..
I'd love to hear your thoughts!!
(simplest program in iPhone ever)
while on my system iOS sdk 5.0 and XCode 4.2 IDE is already installed if you want to look at installation and How to start XCode then check my earlier post here..
okay let's begin..
Go to File Menu >> New >> New Project
or press (Shift+Windows/Command Button+N) on keyboard..
select "Single View Application"
Now put some text..
Product Name : HelloWorld
Company Identifier (package name) : com.soft
Device Family : iPhone (set)
finally UN-check options 'Use Storyboard' & 'Include Unit Tests' like this..
select the location mine is Desktop (just for this Tutorial) but
Please Don't save your project on Desktop or My Document, just save in Another Hard Drive (Except Operating System installed Hard Drive)
so here is First look of your application..
now i am going to define the Project Structure and brief information about important files..
# Header File (.h)
# Implementation File (.m)
# XML Interface Builder File (.xib)
# Main File (.m) [it's like main method in C language]
here are these file in our project..
Header File :
Objective-C Header files. Header files contain class, type, function, and constant declarations.
Default look of Header file is like this
Implementation/Source File
The implementation file contains the actual code for the methods of the class we have defined in header file.
Default look of Implementation file is like this
XML Interface Builder File :
Here we do UI work using all UI Controls/Views like Text, Label, Button, Text-Field and Slider etcDefault look of XIB file is like this
Main.m File :
main.m file is the entry point of the program: It's where the program starts running.So now we will add Label to show "Hello World" message in our project
1. open XIB file
2. show Utility (Click on Top-Right Tab)
3. show Object Library (on Bottom -Right Panel)
4. Drag UILabel to View..
like i have shown in image ..
set 'Hello World' message on label
now save project (press Windows/Command button+S)..
its time to execute our project do like this image (press Command+R)
The output Screen will be look like this..
ye hip hip hureeee... we did it.. so this is Hello World in iPhone..
if you want to know some advance Control then go here..
I'd love to hear your thoughts!!
No comments:
Post a Comment