iPhone development - Hello World

by Prasanna Vignesh 24. January 2009 06:17


After installing iphone sdk, the xcode IDE shortcut is automatically placed on the dock. If it does not appear, you are recommended to create one manually.

Running the XCode IDE wont show up any window, and this may confuse any first time .NET developers. Instead, there is a global menu bar on top of the desktop
that shows the menu of the currently running application. Lame !

Once you find the menu bar, select File > New Project

Then you will be taken to a dialog where different project types are available to choose from. In the left side panel select iPhone application.

Then in the rightside pan we will start with a view based application and press create

Enter helloworld when a name for the project is prompted. The wizard creates a runnable empty project named hello world.

Press the Build and Go button which is a green color play button on the tool bar of the hello world project window…

If every thing was fine, you will see the iPhone emulator running for the first time, then loading your new empty white screen project on iPhone. You can end the project by pressing the iPhone bottom screen button, and then you will see the icon of your application on the iphone emulator.

Now we need to make this empty application into a Hello World application.


Find the helloworldViewController.m file in the project files in the right pan, click on it to view it’s contents in the bottom pan.

Scroll till the last line of the code where u see the line

@end

Paste the following code before the @end line, and press build and go…


You will see an iPhone message box that says “hello iPhone World” :)

Code:


- (void)viewDidLoad {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello World" message:   @"Hello iPhone World !" 
                                                   delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alert show];
    [alert release];   
   
   
    [super viewDidLoad];

}

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Tags: ,

iPhone Development

Comments

12/21/2009 4:14:06 PM #

Aloe Moisturizing Lotion

Aw, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... but what can I say... I procrastinate alot and never seem to get something done.

Aloe Moisturizing Lotion United States |

12/21/2009 4:20:01 PM #

Aloe Moisturizing Lotion

Aw, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... but what can I say... I procrastinate alot and never seem to get something done.

Aloe Moisturizing Lotion United States |

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen, Modified by Prasanna Vignesh.



About Me

Prasanna Vignesh Prasanna Vignesh
Mobile application developer at ZSL. More...



RecentPosts

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar