iPhone Application Development
Wall Script
Wall Script
Sunday, February 03, 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.
web notification

65 comments:

  1. 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!!

    ReplyDelete
  2. but then also thanks for the tutorial!

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

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

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

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

    ReplyDelete
  7. thanks guys Keep the good work up :)

    ReplyDelete
  8. nice one.. good for the beginner.. thanks

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

    Thanks

    ReplyDelete
  10. Is it possible to develop iphone applications on Windows ?

    ReplyDelete
  11. This comment has been removed by the author.

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

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

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

    ReplyDelete
  15. How can i download Xcode iphone simulater for windows 7?

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

    ReplyDelete
  17. Nice Sharing Arun. Thanks a lot!

    ReplyDelete
  18. 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.

    ReplyDelete
  19. Fantastic tutorial you have given great!

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

    great style to explain the things..

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

    ReplyDelete
  22. But sir how to use this software on Window 7

    ReplyDelete
  23. Great! I like to develop for iPhone

    ReplyDelete
  24. 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.

    ReplyDelete
  25. When will you publish the next tutorial??

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

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

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

    ReplyDelete
  29. can i xcode on vmware mac image?

    ReplyDelete
  30. 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.

    ReplyDelete
  31. 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.

    ReplyDelete
  32. 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!

    ReplyDelete
  33. 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.

    ReplyDelete
  34. 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.

    ReplyDelete
  35. 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.

    ReplyDelete
  36. 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.

    ReplyDelete
  37. 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.

    ReplyDelete
  38. 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

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

    ReplyDelete
  40. 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

    ReplyDelete

  41. 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.

    ReplyDelete
  42. 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.

    ReplyDelete
  43. 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.

    ReplyDelete
  44. 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.

    ReplyDelete
  45. 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.

    ReplyDelete
  46. 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!!

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

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

    ReplyDelete
  49. 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...

    ReplyDelete
  50. Too much helpful information IPhone development. Thank you very much

    ReplyDelete
  51. 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.

    ReplyDelete
  52. Wow, really appreciate for this, I want to create an applicaton for daftarperumahanmurah.com. Thank you

    ReplyDelete
  53. Your article should be very useful for me. Thank you for sharing this info!!! Keep it up sir

    ReplyDelete

mailxengine Youtueb channel
Make in India
X