9lessons programming blog
Loading Search
9lessons Bring Friends
Wall Script
Follow Me:
Sunday, February 3, 2013

iPhone Application Development

I received lots tutorial requests from my readers that asked to me, how to start iPhone and iOS application development. We are planning to write a iPhone and iOS application development tutorial series for this you need a Mac iOS and Xcode IDE. Just follow these steps and you can create a simple “Hello World” program.

Getting Started with Iphone

Author
Arun Kumar Munuswamy
Arun Kumar Munusamy

Mobile Application Developer
Chennai, INDIA

Step 1
Open XCode and click create new project as shown in below image.
Getting Started with Iphone

Step 2
Select an empty application
Getting Started with Iphone

Step 3
Enter project name and set device family as iPhone.
Getting Started with Iphone

Step 4
Set project location and click create button.
Getting Started with Iphone

Step 5
Your project will be created as shown below.
Getting Started with Iphone

Step 6
Project property windows contains appdelegate files and other supporting files. We need to create a screen/class with xib(user interface). Right click on the project folder and select new file as shown in the below image.
Getting Started with Iphone

Step 7
You have to select Objective-C class and Click next
Getting Started with Iphone

Step 8
Rename the class to homescreen(what ever you wish) and select UIViewController in the Subclass of dropdown and check the “with XIB for user interface” to include user interface file and click next
Getting Started with Iphone

Step 9
It will ask you to select location to create file. You no need to change the default location. You can click create button.
Getting Started with Iphone

Step 10
Home screen has been successfully created and it will look like below image.
Getting Started with Iphone

Now open homescreen.h file and create a UIButtonField with its onclick function programmatically with the below mentioned code.

@interface homescreen : UIViewController
{
IBOutlet UIButton *btn_hello;
}

@property(nonatomic, retain)IBOutlet UIButton *btn_hello;

-(IBAction)btn_hello_click;

@end


Now your homescreen.h file will look like this
Getting Started with Iphone

Now open homescreen.m file and synthesize your button field at top and add a alert box in the button click function as shown below
@synthesize btn_hello;

-(IBAction)btn_hello_click
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Success !!!"
message:@"Hello iPhone"
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
}

The memory allocated by the button has to be released manually as shown below
- (void)dealloc
{
[btn_hello release];
[super dealloc];
}

So your homescreen.m file will look like the below shown image
Getting Started with Iphone

Step 11
Now it’s time for design part. Open the homescreen.xib file and drag a button in the right side object window and drop it in the view controller.
Getting Started with Iphone

Step 12
Now double click on the button and enter text as “Click Me !”.
Getting Started with Iphone

Step 13
Now under objects panel on left side, right click on the button as shown below
Getting Started with Iphone

Step 14
Now click on the “Touch Down” option and link it to “File’s Owner” as show below.
Getting Started with Iphone

Step 15
Now the button click function declared in header and main file will get pop up.
Getting Started with Iphone

Step 16
Select the function. This process will link the function to the button click event.
Getting Started with Iphone

So design part is over. Now your application is ready. But, the problem is this is an empty application. Application don’t know where to start. So we need to redirect the application to the home screen.
Open Appdelegate.h file and declare UINavigationController as shown below

@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
UINavigationController *navigationController;
}

@property(strong,nonatomic)UINavigationController *navigationController;

@property (strong, nonatomic) UIWindow *window;

@end

Your Appdelegate.h file will look like this

Getting Started with Iphone

Step 16
Now open AppDelegate.m file and mention the homescreen to be the start point of the application as shown below
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIViewController *homeController = [[homescreen alloc] initWithNibName:@"homescreen" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:homeController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}


Step 17
Your AppDelegate.m file will look like below image. Now it’s done. Click on the run icon on the top left corner as shown in below image.
Getting Started with Iphone

Step 18
It will take few min to open the iphone simulator and your project. Your application will look like below image
Getting Started with Iphone

Step 19
Now click the “Click Me !” button.
Getting Started with Iphone
Congratulations. You are now a iPhone developer.
Comments
{ 62 comments }
Tech Chronics said...

And if any one like me won't have MAC then he can simply use Phone GAP which is cool and works awesome, supports many platforms and the best part you can also use Web application programming languages like Javascript for giving it action, CSS for making the UI and HTML for making objects.
http://phonegap.com/ and for tutorials about Phone GAP you can simply see the documentation, if you know Javascript CSS and HTML then just the way how to use the IDE and everything you will learn automatically!!

Tech Chronics said...

but then also thanks for the tutorial!

Pratik Doshi said...

hey if you can also give a demo on "facebook like commenting system" which allows add, edit and delete of comments

Unknown said...

cool.. but how to i test it on my iphone??

Anonymous said...

nice

Yanker said...

thanks for you tutorial, I´m waiting by the next tutorial, thankssssss !!!

Lasse Rafn said...

I would have liked some explanation of each part but thanks :)

phphunger said...

great work...

Anand said...

Nice Startup!

Pradeep Srivastava said...

thanks guys Keep the good work up :)

Renato said...

Step 1
buy a mac

jayson.ph said...

nice one tutorial..

jayson.ph said...

nice one.. good for the beginner.. thanks

Tanmoy Mondal said...

Can you please tell me from where I can get Mac iOS and Xcode IDE.

Thanks

dskanth said...

Is it possible to develop iphone applications on Windows ?

Anonymous said...

thanks a lot

Arun Kumar Munusamy said...
This comment has been removed by the author.
Ajay Surya said...

nice

Majharul said...

Again a great lesson from 9lellons. Thanks a lot.

Sagar Thesia said...

Nice Tutorial

Pratibha said...

Nice Tutorial But this is just a start hope we will see more iPhone tutorials on 9lessons

Dian Nugraha said...

How To I Deploy In Operating System Windows 7...??

Amit Das said...

How can i download Xcode iphone simulater for windows 7?

iRvanFauziE said...

nice, more tutorial please :-D
thanks for this one.

Srinivas Reddy said...

Nice Sharing Arun. Thanks a lot!

SamuelCarey said...

you are providing a nice step by step information but i can not displying the images which you are post in this blog.this tutorial is very helpful for me in future because i want to learn an iPad development.

Krishna Parmar said...

Fantastic tutorial you have given great!

Mahendra Singh said...

Well Done Tamada... I love such a step by step tutorials...

great style to explain the things..

Alexander said...

I waited this tutorial since two years , thank you Arun!

Gaurav said...

But sir how to use this software on Window 7

Anton said...

Great! I like to develop for iPhone

Arun Kumar Munusamy said...

Officially it is not possible to develop native IPhone applications in windows OS. But unofficially, i heard that OS X(mac OS) can be installed through virtual machine in windows OS and application can be developed. I will try on this process and if i get succeed means i will post that as an article here.

Yanker said...

When will you publish the next tutorial??

SUNIL KUMAR said...

Great article ! Thanks for this :)

Mahesh said...

Very good step by step tutorial. I hope to see more on the deployment tutorial :)

mobile funny sms said...

nice tutorial and thanks for it

Ryan Lawrence said...

This is a nice tutorial to develop your own first iPhone Application.

Arun Kumar Munusamy said...

@Yanker: Next tutorial is almost ready. Will publish soon.

Anonymous said...

can i xcode on vmware mac image?

Gerard thomas said...

Good Knowlege..

Zeus lambert said...

There is big range of people are using Mobiles app so its necessary think to iPhone app development.You are describing good information about iPhone app development.

John Murphy said...

Great article dude! Best part about this article is the step by step approach towards the process of iOS app development. Am sure a lot of readers, especially developers, will be greatly benefited by this article.

Branden Garza said...

Thanks for this 16 Excellent Steps to Develop iPhone Apps To Success In Iphone Application Development. It´s people like you who make the Internet to a such fantastic and great forum for collaboration and learning. Keep up the good work!

Morgan said...

Thanks for providing this useful tutorial in developing a simple iPhone “Hello world” program. The screenshots that you have provided are useful in understanding the various steps with clarity.

George Gallop said...

The people who want to develop iPhone application on windows should remember time is precious. Tool that can be used for iPhone app develpoment is the Dragonfire SDK.

Tyrone Delgado said...

Firs app by picking a project that you simply would get pleasure from completing. Don't select a quite difficult project or even a project that takes a extended time.

Oleg Wilcox said...

The information in your post about iPhone is more interesting. and this info is more useful for the developers to develop the iPhone apps. Thanks for share this valuable info.

Carter Hyde said...

This is a very simple but effective tutorial that is clearly illustrated with the help of various screen images and graphics to develop very simple “Hello World” program without too much technical knowledge.

Lewis Downs said...

Good work in this article and most of the technical points are covered for iPhone App development work. Looking forward to further information about iPhone development in your next blog

Zeuslambert said...

These days, there are already several applications that could achieve iPhone app growth on Windows. The applications gather requirements the same as a Mac.

AndolaSoft said...

Nice post. Thanks for sharing step by step approach towards the process of iOS app development. Looking forward to further information about iPhone application development.

Thanks
Andolasoft

Mobilepundits said...


You have provide a nice and step by step info, lots of developer are gone love this blog because this blog contain so many useful information for developer.

iPhone Application Development said...

really very interesting and step by step guidelines to be iPhone Apps Developer. This is really going to help a lot for those who want to be a iPhone Developer.

Anonymous said...

thanks. very helpful.

I didn't import homescreen.h into AppDelegate.h at first, had to dig around a little to figure that out. Great tutorial however.

Thane Martin said...

We are now looking for some more advance tutorial from you. As this tutorial supposed to help new developer to learn more advanced functionality for iPhone application development.

Sienna Amelia said...

This was an interesting tutorial. Might be months later I am been here for learning this JSON Parse but any way this is good that helped me a lot. Thanks for the good share of content.

iphone application development company said...

I really appreciate your post. Thanks for sharing such a valuable information. iPhone application development industry is increasing rapidly and now a days its pretty simple to get your favorite application in mobile.Thanks!!

rabeea ahsan said...

THANKS. IT WAS VERY HELPFUL... PLEASE SHARE AN ARTICLE ON "PHONEGAP" BASICS

Android App Development Company said...

Hi, very nice blog, it is easy to understand of Guidelines for iphone application development, Thanks for sharing this useful info..

iphone app development said...

I found lots of interesting information here. The post was professionally written and I feel like the author has extensive knowledge in this subject. Arun, thanks for sharing such a informative post for iphone app development beginners...

Anonymous said...

Too much helpful information IPhone development. Thank you very much

Mobiers an iOS App Development Company said...

Great Job... You have explained the entire development process in such easy words that will not only going to help the newbies but also the the experts. The images used are brilliant which will give an nice illustration for each step.

Post a Comment