Programming Objective-C in XCode 4 – iPhone iOS 4.3 Hello, World! tutorial

flattr this!

You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Programming Objective-C in XCode 4 – iPhone iOS 4.3 Hello, World! tutorial”.


165 Responses to “Programming Objective-C in XCode 4 – iPhone iOS 4.3 Hello, World! tutorial”

  • avatar costa Says:

    Great !

    thanks dude !

    Do you have something else ?

  • avatar Rob Says:

    The app compiles and runs but the button does not change the text of the label. I’ve read the part where the label object is dragged onto the view four times. How is the label connected to the textLabel property?

    Am I missing something obvious?

  • avatar Rob Says:

    Found out what I missed at the end of the tutorial:

    Now, right click again on your File’s owner. On the second you will find our “textLabel”. Drag the circle on the right of “textLabel” to our label and release there.

  • avatar Fahad Says:

    Hey Paul hope you dont mind me posting your link on my blog. This helped me to get started. great site and a great tutorial :)

    Thanks

  • avatar Esakkimuthu Says:

    This Tutorial Very Useful for beginners in iphone apps

  • avatar blueskyvan Says:

    Thanks for the tutorial. Do you create apps for hire?

  • avatar sumit Says:

    hey thanks alot ..

  • avatar Paul Peelen Says:

    @blueskyvan Yes, I do.

  • avatar Pheonixphile Says:

    Thanks! Short and sweet. Nice intro app.

    Being new to iOS development, the number of options seems overwhelming.

    Didn’t have the changing of background color, though, as was suggested in “What you will learn”.

  • avatar Bret Says:

    Yo. I just did your tutorial. Very helpful! However, when I run my app, the button does not do anything. I have the label attached to the textLabel and the “Label” text, but the button does not change the text to “Hello World!”

    Am I missing something? My code matches yours exactly and I do not get any errors.

  • avatar John Says:

    Hi Paul
    Can’t see the images – is it just me :-) )
    John

  • avatar Paul Peelen Says:

    @Bret You need to connect your action to the button as well.
    @John I think its just you mate, it works fine here.
    @Everyone Else: Thanks for the kind word. I’ll try to write some new tutorials soon.

  • avatar Tuc Says:

    Thanks, being new to both mac world and objective C and having to start an iphone app comercial project soon, I found your tutorial greatly encouraging. Nice and simple

  • avatar David C Says:

    When I get to the step where I press (Command key) + (Shift key) + = after clicking on the button, it doesn’t do anything, and then when I click on the File’s owner, that doesn’t do anything either…?

    I’m using the newest Xcode 4.1

  • avatar Rex Says:

    I’ve copied all the codes for the project. Drag the file owner to the button. The first .h file need to add <UIkit….. something like that to build without error. And after that, Label is still Label. I've linked all things. Is this work for the xcode 4.1? Thanks.

  • avatar Sudip Barman Says:

    Thanks Boss…
    it is really nice for the starter like me…
    its give me a basic idea…
    Thanks Again…

  • avatar Paul Peelen Says:

    @Rex Yes, is works for XCode 4.1. I think what you should do is download the example I uploaded. Compare your result with that result and I think you figure it out.

  • avatar Ivan Says:

    This is an amazing walkthrough…thank you so much for taking your time to write this up. It’s given us a good overview to programming in xcode.

  • avatar Rex Says:

    Thanks Paul with your prompt reply!
    Actually I’ve copied all your codes and give it a try. Will there be a packed project file for download? Thanks.

  • avatar Paul Peelen Says:

    @Rex My bad, thought I uploaded one. I’ll do so today and notify you.

  • avatar diogo Says:

    Congrats on your blog.
    Its sad to see wanna-be programming teachers leaching this material.
    Making enemies is a sign that your doing a good job and that you are a step ahead of everyone.

    Make sure you always leave an egg in your text..

    -cheers

  • avatar diogo Says:

    congrats…THIS IS THE ONLY TUTORIAL THAT ACTUALLY WORKS..
    finally… i see a light in the end of the tunnel…

    lots of bugged tutorials out there

  • avatar Dean Graham Says:

    Can this app now be moved to an IPhone? Can you show a novice how to do it?

  • avatar Paul Peelen Says:

    Hi Dean!

    I think someone has asked that already, but to answer it now anyways:
    To install an unofficial application, you can do it two ways:
    1) The official way, the way I suggest you do it as well. You need to get yourself a Apple Developers license ($99/year). After that you should create the appropriate certificates and profiles which you use with xCode. That way you can install applications directly from xCode to your iOS device.

    2) The un-official way. This is the way I do not recommend. You need to jailbreak your iOS device (voiding the warranty as well I believe!) and install AppSync (google it). When thats done you can install apps by building them with xCode and then drag them using iTunes to your phone. This might work, however you can not debug your application this way.

    I hope my answer helped you.

  • avatar Amy Says:

    Thanks so much for this tutorial! I just started programming in Xcode today to learn how to develop iPhone apps. You really helped me to connect the dots about the basics. Now I’m on to find more good tutorials. :-)

  • avatar Akshay Says:

    Hey Paul,
    Thanks dude, It really simple and easy steps.You explained it in very simple manner.Keep writing.

    Thanks once again

  • avatar Fernando Says:

    i followed all your steps and when running the app i get Build Failed due to the part #import…

    am i missing something here??

    Regards!!!

  • avatar jrom Says:

    thanks dude.

  • avatar Nauhar Says:

    Hi,
    Thanks for the tutorial,
    but i don’t have any “View-based Application” in the page to choose the template.
    I’m running Xcode 4.2, can you help me ?

  • avatar Paul Peelen Says:

    @Nauhar Make sure you have chosen “Application” under “iOS”. it should be there. Otherwise you have a faulty installation of xcode

  • avatar Zhongwei Says:

    Greate tutorial!

    Hope Xcode replace the original tutorial with this

  • avatar Anonymous Says:

    Thanks dude!! was really helpful…

  • avatar Edgar Says:

    Very nice! This is the first “HelloWorld” tutorial i actually could understand! :) Thanks a lot!

  • avatar Paul Peelen Says:

    Your welcome! Just remember to facebook-like and flatr it off course ;)

  • avatar sany Says:

    Hi, thank you for the tutorial but i have a problem I don’t found “HelloWorldViewController.xib” and “MainWindow.xib
    can you help me please ?

  • avatar JC Says:

    Great tutorial! Thank you for this. I actually got it to work.

    I had the same problem as Rex, though. In the “HelloWorldViewController.h” file, after #import it needs .

    So it should read:

    #import

    and then the rest of the code.

    Thank you again!

  • avatar JC Says:

    Sorry! My first comment didn’t post the code… beginners error.

    Meant to say:

    Great tutorial! Thank you for this. I actually got it to work.
    I had the same problem as Rex, though. In the “HelloWorldViewController.h” file, after #import it needs UIKit/UIKit.h (with that command in between these: ) and then the rest of the code.

    Thank you again!

  • avatar Christopher Says:

    Thanks, this got me started. I didn’t have (void)dealloc method in my ViewController.h file. Was this supposed to be created for you automatically? I’m using Xcode 4.1 on Lion.

    Good Tutorial,
    Thank you

  • avatar carl Says:

    Sorry but I thought it was a yawnathon. One day someone will do a series on an app design that is actually useful.

  • avatar Paul Peelen Says:

    @Carl, sorry you feel that way. I hope, for your sake, that “one day” will come soon. Otherwise, feel free to be that someone.

  • avatar Kevin Says:

    I needed a quick start intro into xCode 4.1. This did the job nicely. Much appreciated.

  • avatar JohnHo Says:

    great start for beginners. thanks a lot.

  • avatar Silby Says:

    Paul, brill, spent hours with apple docs trying to do this!

  • avatar Solomiya Says:

    A million of thanks to you!!

  • avatar James Says:

    Good stuff, thanks, but it does need to be updated for 4.2. Many, many differences.

  • avatar Daniel W Says:

    Hi

    This is a great blog and really quite helpful. But right at the start of the code in .m is the line below:

    #import “HelloWorldViewController.h”
    But I keep getting the message below –
    “HelloWorldViewController.” file not found

    How can i rectify this?

    Also, once I have written this code, will it be the same for the majority of apps that I create?

    Thanks

  • avatar Paul White Says:

    Slight differences between instructions and what I found in Xcode 4.2 but otherwise, it works well. Yay. First IOS app.

  • avatar Hossein Says:

    hi
    thanks BUt My Xcode 4.2 IN IOS>Application Don’t have any View-Based Application
    It’s install Fine but i don’t have it…even first menu not look like to your Xcode menu
    what do i do?

  • avatar nate Says:

    I was trying to do this in Xcode 4.2.1 and i had some problems with this part of the code:
    @synthesize textLabel;

    - (void)dealloc
    {
    [textLabel release];
    [super dealloc];
    }

    There were errors next to [textLabel release] saying : Release is unavailable: not available in automatic reference counting mode….and….ARC forbids explicit message send of ‘release’
    Also errors on [super dealloc] saying: ARC forbids explicit message send of ‘dealloc’
    thanks in advance for any help

  • avatar Moses Says:

    Great and helpful resource. But like James said, it needs to be updated for 4.2. I’ve handle them myself but there are many differences:

    Single View Application – instead of View-based Application
    MainStoryboard.storyboard – instead of HelloWorldViewController.xib

    and so on….

Leave a Reply