Mar 27
Finally Apple released an initial version of iPhone SDK Beta 2 which has Interface Builder. It’s really cool to create applications. I wanted to put together the first step of creating HelloWorld quickly on it.
- Open XCode
- Create a new Project as “Cocoa Touch Application”
- Provide the project name as “HelloWorld” on your selected folder and Click Save
- Open Interface Builder and Click “Cocoa Touch” tab on the top
- Select Window and Click “Choose”
- Design the UI something like the following:
- Save it as MainWindow under the same folder as HelloWorld
- When it prompts to include it for the build, Choose “HelloWorld” and click Add
- Quit the Interface Builder
- Go back to XCode and edit “HelloWorldAppDelegate.m”
- Replace the content of the method applicationDidFinishLaunching with the following snippet. Save it and Run it.
// Create window
self.window = [[[NSBundle mainBundle] loadNibNamed:@”MainWindow” owner:self options:nil] objectAtIndex:0];
// Show window
[window makeKeyAndVisible];
Download the XCode Project: iPhone - HelloWorld.zip?

March 27th, 2008 at 10:50 pm
Thanks so much! I’ve been trying to figure out how to actually load my nib, since the documentation is currently non-existent (what do I expect, since the new beta was only just released). I’ll have to give this a try!
March 27th, 2008 at 11:02 pm
[...] cadamson wrote an interesting post today onHere’s a quick excerptFinally Apple released an initial version of iPhone SDK Beta 2 which has Interface Builder. It’s really cool to create applications. I wanted to put together the first step of creating HelloWorld quickly on it. … [...]
March 28th, 2008 at 12:05 am
[...] Iphone Instylez wrote an interesting post today onHere’s a quick excerptHello World iPhone Native Application iPhone, mac os x, programming 1 Comment » Finally Apple released an initial version of iPhone SDK Beta 2 which has Interface Builder. It’s really cool to create applications. I wanted to put together the first step of creating HelloWorld quickly on it. Open XCode Create a new Project as “Cocoa Touch Application” [...]
March 28th, 2008 at 10:35 am
[...] View Tutorial [...]
March 28th, 2008 at 10:44 am
Thanks, but I am lost … I try to connect a button to the controller, like for a Mac OS X cocoa app, but doesn’t seem to work.
Any ideas ?
March 28th, 2008 at 4:01 pm
Awesome! Thanks for the info!
March 29th, 2008 at 4:04 am
I am working on the other sample to handle tap or touch events through interface builder. No luck so far.
March 29th, 2008 at 12:53 pm
And what about the tabbar ? (toolbar)
March 29th, 2008 at 1:04 pm
Anyone know how to use the viewcontroller/navigationcontroller with interface builder.
March 29th, 2008 at 1:21 pm
how do you configure a button to launch an action with the interface builder? (eg. a button is touched->a label is changed)
I’m new to cocoa and it’s frustrating
March 29th, 2008 at 1:35 pm
You have an example in the site to do it for Cocoa on Mac OS X but not for iPhone yet.
March 29th, 2008 at 2:52 pm
Muthu,
I couldn’t find the sample. Could you point me to it?
thanks,
March 29th, 2008 at 5:24 pm
Thanks! This got me started. My only problem was I had to fix the formatting of the code snippet and replace the quotes around @”MainWindow” (it’s good in the .zip file)
March 29th, 2008 at 6:27 pm
Thanks for providing the basic instruction on how to connect IB to Xcode, especially the code snipped.
March 29th, 2008 at 8:29 pm
For Cocoa program to handle event, please look at the example here at: http://techblog.muthuka.com/index.php/2008/03/21/random-number-generator-in-cocoa-application/
March 29th, 2008 at 8:35 pm
Thank you! I was really struggling.
March 30th, 2008 at 3:41 pm
Saviour, while this is clearly basic stuff, without it you can’t climbing the ladder to build anything. For me XCode and Interface builder are alien technologies (done loads of C, C++, java etc) but it’s always painful getting started and your contribution has helped me a great deal. Thanks.
March 30th, 2008 at 4:19 pm
Great !. Thanks for the all the info.
March 30th, 2008 at 9:30 pm
[...] Hello World iPhone Native Application | muthu arumugam blog (tags: iphone programming interface builder sdk) Read More Post a Comment [...]
March 31st, 2008 at 4:20 am
[...] in sein Programm einbindet, dem ist jetzt geholfen. Muthu Arumugam veröffentlichte auf seinem Blog ein Hello World Tutorial welches dies in einer Step by Step Anleitung sehr gut demonstriert. [...]
March 31st, 2008 at 1:12 pm
Hey , are NSLog statements getting printed in the xcode console?. when i was using the first SDK beta version,it worked fine. Now i am not seeing any of my NSLog statements in the console (i have the second SDK beta version installed). This happens only for the iPhone application,when i use the same xcode to build a Mac OS application, NSLog statements are getting displayed in the console. there is no issue with th NSLog statement as such ( NSLog(@”test “); )
. any idea?
~mp
March 31st, 2008 at 2:18 pm
In Beta 2 SDK, that’s broken and you can see the log only in Console.app (i read this in apple developer discussions somewhere)
March 31st, 2008 at 4:53 pm
ohh ok…i was wondering w.r.t NSLog statements..thanks Muthu..
Has anyone tried of MVC type sample application so far?.. is it really possible with the current SDK version. any clues?….
March 31st, 2008 at 7:43 pm
i have a text-field (its an IBOutlet of UITextField) on the screen i which accepts some number,i need to take this value into a float variable in my code. any idea which is the class and method used for this purpose. if some one has found already, pls share it…
April 1st, 2008 at 5:57 pm
w.r.t to my earlier post (UITextField).
finally it worked with the following code.
float rate = [rateField.text floatValue];
rateField is a textfield on the screen which is an IBOutlet.
April 2nd, 2008 at 11:32 am
I have written a tutorial on how to make an iPhone app using interface builder with interaction. Have a look: http://zone12.co.uk/iCode/
April 2nd, 2008 at 12:21 pm
Awesome. That’s the link which i missed it while building interaction in my code. Thanks.
April 4th, 2008 at 3:11 am
how to draw a simple line on a window without using the IB. ( It seems, IB does not have that feature). any help?
April 8th, 2008 at 10:55 am
[...] ? I found an Interface Builder + iPhone tutorial here. Posted by Peat Filed in Apple, Awesome, Banknotes, Coding, Programming, Web Services, iPhone, [...]
April 10th, 2008 at 1:33 pm
hi, can anyone pls guide me which class/method i need to use in the following.
i will have a home button on the navigation bar , pressing the button should lead me to the home page of the iPhone where all the applications will be listed. (Like the black button on the iPhone simulator / iPhone ,outside the screen).
April 11th, 2008 at 1:38 pm
use exit(0); in the method to take the app to iPhone home page.
July 18th, 2008 at 4:06 pm
[...] Here is probably the most simplified way to create a Hello World application for the iPhone or iTouch: http://techblog.muthuka.com/index.php/2008/03/27/hello-world-iphone-native-application/ [...]
July 19th, 2008 at 9:36 am
Nice blog, i have added it to my favourites, greetings
July 21st, 2008 at 1:44 pm
I find this blog very interesting, i will be here everyday till now. Greetings
July 31st, 2008 at 4:00 am
[...] Descargar Proyecto Hello World: iPhone HelloWorld Enlace de la Noticia [En Ingles] [...]