1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome both old friends and new to the all new Walt Disney Secrets :-D Please take a moment to say hi

XCode problem (For Tom or Keith)

Discussion in 'Gadgets and Gizmos' started by josh.p., Jul 10, 2010.

  1. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    I'm already pulling my hair out writing my 'hello world' application and thought I must be doing something really stupid that I haven't noticed, so here are the steps I've taken;

    In the 'helloworld_001ViewController.h' file, I've got the following code;
    Code:
    //
    //  helloworld_001ViewController.h
    //  helloworld_001
    //
    //  Created by Josh Parry on 10/07/2010.
    //  Copyright __MyCompanyName__ 2010. All rights reserved.
    //
    
    #import <UIKit/UIKit.h>
    
    @interface helloworld_001ViewController : UIViewController {
        IBOutlet UILabel *label;
    }
    
    - (IBAction)hello:(id)sendr;
    
    @end
    
    
    In the 'helloworld_001ViewController.m' file, I've got the following code;
    Code:
    //
    //  helloworld_001ViewController.m
    //  helloworld_001
    //
    //  Created by Josh Parry on 10/07/2010.
    //  Copyright __MyCompanyName__ 2010. All rights reserved.
    //
    
    #import "helloworld_001ViewController.h"
    
    @implementation helloworld_001ViewController
    - (IBAction)hello:(id)sendr{
        label.text = @"Hello World!";
    }
    
    
    In the IB, I've pressed control and dragged a 'fishing line thing' from the file's owner to the label and then selected "label" from the black menu that appears.

    Then I've dragged a 'fishing line thing' from the button to the files owner and selected "hello:" from the black menu that appears. The problem is that once I've hit enter and cmd to run the code in the simulator, the 'Hello World!" label is displayed even though the button isn't pressed.

    :unsure:
  2. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    Ignore this :D I had typed 'hello world' into the label rather than leaving it blank!

    Something tells me I'm on a looong road to learning this :rotfl:
  3. Slowhand
    Offline

    Slowhand Cruise Director Forum Host

    Joined:
    Jul 29, 2008
    Messages:
    5,721
    Likes Received:
    126
    Trophy Points:
    63
    Gender:
    Male
    Location:
    Staffordshire U.K.
    Darn it! I was just about to jump in and tell you about this Josh, but seeing as your post was aimed at Tom or Keith, I thought I`d stay out of it! :lol:
  4. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    I thought this sort of thing would be beneath your level of teck-ni-kal knowledge and I didn't want to waste your's (or dorothy's :wink:) time! :lol:
  5. catrancher
    Offline

    catrancher Assistant Cruise Director Forum Host

    Joined:
    Oct 5, 2008
    Messages:
    6,096
    Likes Received:
    64
    Trophy Points:
    48
    Location:
    Cumming, GA. A small suburb of Atlanta.
    Josh,

    Glad you got it sorted out! :yes:

    It's a great feeling of accomplishment once you get something working. And now that you've made that mistake for the first time, the next time, you'll know better or be able to find it faster should you make the same mistake again.

    If you want to get started in iPhone programming with the best book on the market, you need to get this one:

    IPhone Programming: The Big Nerd Ranch Guide

    This is by a guy name Aaron Hillegass who runs a place here in town close to where I live called the Big Nerd Ranch. I've met Aaron on a couple of occasions at various Apple events here in town and you couldn't meet a nicer guy. He's also been involved with Cocoa since the original Next days and is probably one of the most technologically smart people I've ever met. I'd dearly love to be able to go to either the Cocoa Boot Camp or the iPhone Boot Camp that he runs. Anyway, his books are probably some of the most definitive texts available today on programming for the Apple platforms. He's also supposed to be working on an OpenGL ES book as it applies to the iPhone platform.

    You won't go wrong if you pick this book up. It's outstanding! :thumbsup:

    Just be sure to use the link on the Secrets site if you're going to get it from Amazon!

    Tom :)macwave:... [information release];
  6. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    those are the books I have Tom! I had no idea the ranch was so close to you???
  7. catrancher
    Offline

    catrancher Assistant Cruise Director Forum Host

    Joined:
    Oct 5, 2008
    Messages:
    6,096
    Likes Received:
    64
    Trophy Points:
    48
    Location:
    Cumming, GA. A small suburb of Atlanta.
    Yep! The Big Nerd Offices are just down in Atlanta. Not too terribly far from where I work when I have to go into the office.

    The actual Ranch itself (where they teach some of the classes) is located at Banning Mills. Maybe an hour and a half drive from my house. It's actually southwest of Atlanta about 45 miles and I live almost due north about 35 miles.

    I really want to take some of the classes there!

    Tom :)macwave:... approaching Nerdvana!)
  8. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    Thanks Tom, I'll have a look at those books :yes: The one I'm using is by Rory Lewis called 'iPhone & iPad apps for absolute beginners' This is the first coding I've really ever done (apart from CSS & HTML) so it's good as it is all explained in layman terms :yes:

    I've now got so far as to make 3 'hello world' apps.

    The 1st has a button that you press to display 'hello world'
    The 2nd is 'Hello World' in a table
    The 3rd is 'Hello World' in an editable table (Well, you can click 'edit' and then delete the items in the table)

    Not exactly great but I'm learning :)

    My aim is to create a reference application for edible weeds for reptiles. Seems a bit boring but it's going to be handy for me when I am out at a garden centre or on a walk and there is a plant I'm not 100% sure is edible or toxic. I just want a simple photo layout with a picture and when clicked I want it to display if it is edible and whether it should fed in moderation, or if it should be fed as a staple part of the diet :yes:
  9. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    me too! :yes: my ideal few weeks would be a WWDC followed by some classes at the ranch :D
  10. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    Josh keep going with it! With the ipad too, there's a heck of a great opportunity to get your app out there for people and once you get to know it, cocoa is a really nice language to use!

    Just be careful of memory management, that's the best tip I can give you to save you frustration later
  11. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    Im going to stick at it :yes: Im doing various lessons in the book and although I dont understand a lot of the technical words and what they do, I have a very basic understanding of how to use them :yes:

    The UI kit bits (dont have a clue what the technical term is) are *really* handy :yes: I was so shocked at how expert even a simple table looks without any effort at all!
  12. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    The way the table view requests the data from the controller which then grabs the data from the data model is one of the most wonderously elegant things I've ever seen :lol:

    I came to cocoa from languages where I was used to doing for row = 1 to 10; column=1 to 10; data[row,column]=blahblah etc.

    I was amazed when the view started asking me for the data at the cells it needed! Of course it's so brilliant because it only needs to ask for the cells that are display or in use at that time, you can have a nice mapping through to the data and so on.

    Only thing you have to concentrate on is making sure that your data access routines are efficient and can deliver the data quickly when asked :yes:

    The other mega cool thing is the whole Mac ecosystem. You have these views that work on a desktop macosx system, an iphone and an ipad! I feel microsoft has just missed a huge thing here
  13. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    wooooooosh, over my head lol. Say that again in 6 month's time :lol:
  14. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    If you keep on with that book and don't give up, I bet in a month or so you'll read that and think AHHH sure well thats easy and obvious :lol:
  15. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    I hope so :lol: how is the disney secrets app coming along?
  16. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    Well I've got a few little ones, hours and the like but when the ipad came out, it offers such a wonderful new size of screen to develop for that I'm pondering the best way to take advantage of it right now
  17. keith
    Online

    keith Camera nut Staff Member Administrator Forum Host

    Joined:
    Jun 14, 2008
    Messages:
    19,396
    Likes Received:
    397
    Trophy Points:
    83
    Location:
    United Kingdom
    How you doing with it Josh? any screenshots??? I know you wont think its very impressive yet but I just love seeing other people's dev projects :)
  18. josh.p.
    Offline

    josh.p. Addicted to Mickey

    Joined:
    Jun 18, 2008
    Messages:
    9,159
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Wirral
    I've got nothing done on my own app, I'm still going through the lessons in the book I've done a few lessons. This is one of my first apps, which is basically just a little button that you press and the ant appears LOL;
    I know it's not at all useful but the book teaches you to do things like that so you learn the basics.
    [​IMG]
    [​IMG]

    I'll be sure to post screen shots when I start the app I'm looking at making, it's going to be a long road, though.

Share This Page