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.
Author
Arun Kumar Munusamy
Mobile Application Developer
Chennai, INDIA
Mobile Application Developer
Chennai, INDIA
Step 1
Open XCode and click create new project as shown in below image.
Step 2
Select an empty application
Step 3
Enter project name and set device family as iPhone.
Step 4
Set project location and click create button.
Step 5
Your project will be created as shown below.
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.
Step 7
You have to select Objective-C class and Click next
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
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.
Step 10
Home screen has been successfully created and it will look like below image.
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
{
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
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];
}
-(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];
}
{
[btn_hello release];
[super dealloc];
}
So your homescreen.m file will look like the below shown image
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.
Step 12
Now double click on the button and enter text as “Click Me !”.
Step 13
Now under objects panel on left side, right click on the button as shown below
Step 14
Now click on the “Touch Down” option and link it to “File’s Owner” as show below.
Step 15
Now the button click function declared in header and main file will get pop up.
Step 16
Select the function. This process will link the function to the button click event.
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
{
UINavigationController *navigationController;
}
@property(strong,nonatomic)UINavigationController *navigationController;
@property (strong, nonatomic) UIWindow *window;
@end
Your Appdelegate.h file will look like this
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;
}
{
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.
Step 18
It will take few min to open the iphone simulator and your project. Your application will look like below image
Step 19
Now click the “Click Me !” button.
Congratulations. You are now a iPhone developer.
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.
ReplyDeletehttp://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!!
but then also thanks for the tutorial!
ReplyDeletehey if you can also give a demo on "facebook like commenting system" which allows add, edit and delete of comments
ReplyDeletecool.. but how to i test it on my iphone??
ReplyDeletenice
ReplyDeletethanks for you tutorial, I´m waiting by the next tutorial, thankssssss !!!
ReplyDeleteI would have liked some explanation of each part but thanks :)
ReplyDeletegreat work...
ReplyDeleteNice Startup!
ReplyDeletethanks guys Keep the good work up :)
ReplyDeleteStep 1
ReplyDeletebuy a mac
nice one tutorial..
ReplyDeletenice one.. good for the beginner.. thanks
ReplyDeleteCan you please tell me from where I can get Mac iOS and Xcode IDE.
ReplyDeleteThanks
Is it possible to develop iphone applications on Windows ?
ReplyDeletethanks a lot
ReplyDeleteThis comment has been removed by the author.
ReplyDeletenice
ReplyDeleteAgain a great lesson from 9lellons. Thanks a lot.
ReplyDeleteNice Tutorial
ReplyDeleteNice Tutorial But this is just a start hope we will see more iPhone tutorials on 9lessons
ReplyDeleteHow To I Deploy In Operating System Windows 7...??
ReplyDeleteHow can i download Xcode iphone simulater for windows 7?
ReplyDeletenice, more tutorial please :-D
ReplyDeletethanks for this one.
Nice Sharing Arun. Thanks a lot!
ReplyDeleteyou 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.
ReplyDeleteFantastic tutorial you have given great!
ReplyDeleteWell Done Tamada... I love such a step by step tutorials...
ReplyDeletegreat style to explain the things..
I waited this tutorial since two years , thank you Arun!
ReplyDeleteBut sir how to use this software on Window 7
ReplyDeleteGreat! I like to develop for iPhone
ReplyDeleteOfficially 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.
ReplyDeleteWhen will you publish the next tutorial??
ReplyDeleteGreat article ! Thanks for this :)
ReplyDeleteVery good step by step tutorial. I hope to see more on the deployment tutorial :)
ReplyDeletenice tutorial and thanks for it
ReplyDeleteThis is a nice tutorial to develop your own first iPhone Application.
ReplyDelete@Yanker: Next tutorial is almost ready. Will publish soon.
ReplyDeletecan i xcode on vmware mac image?
ReplyDeleteGood Knowlege..
ReplyDeleteThere 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.
ReplyDeleteGreat 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.
ReplyDeleteThanks 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!
ReplyDeleteThanks 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.
ReplyDeleteThe 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.
ReplyDeleteFirs 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.
ReplyDeleteThe 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.
ReplyDeleteThis 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.
ReplyDeleteGood 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
ReplyDeleteThese days, there are already several applications that could achieve iPhone app growth on Windows. The applications gather requirements the same as a Mac.
ReplyDeleteNice post. Thanks for sharing step by step approach towards the process of iOS app development. Looking forward to further information about iPhone application development.
ReplyDeleteThanks
Andolasoft
ReplyDeleteYou 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.
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.
ReplyDeletethanks. very helpful.
ReplyDeleteI didn't import homescreen.h into AppDelegate.h at first, had to dig around a little to figure that out. Great tutorial however.
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.
ReplyDeleteThis 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.
ReplyDeleteI 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!!
ReplyDeleteTHANKS. IT WAS VERY HELPFUL... PLEASE SHARE AN ARTICLE ON "PHONEGAP" BASICS
ReplyDeleteHi, very nice blog, it is easy to understand of Guidelines for iphone application development, Thanks for sharing this useful info..
ReplyDeleteI 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...
ReplyDeleteToo much helpful information IPhone development. Thank you very much
ReplyDeleteGreat 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.
ReplyDeleteGood
ReplyDeleteWow, really appreciate for this, I want to create an applicaton for daftarperumahanmurah.com. Thank you
ReplyDeleteYour article should be very useful for me. Thank you for sharing this info!!! Keep it up sir
ReplyDelete