My First Cocoa Application :noes:

Discussion in 'OT Technology' started by TurkeyChicken, Nov 2, 2005.

  1. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM
    I learned how to use XCode and Objective-C last night and made this little Gas Calculator. I originally had a button you had to click to see the total cost, but a friend helped me make it all automatic.

    Let me know what you think :noes:

    Screenshot 1:
    [​IMG]

    Screenshot 2:
    [​IMG]

    Link to .app file
    http://www.brandonobrien.com/random/GasCalculatorApp.zip




    //edit:
    Link to XCode project file
    http://www.brandonobrien.com/random/GasCalculator.zip

    This is what I used to make my first Cocoa app... it's pretty good for beginners and shows you how to make an interface and how it interacts with the code:
    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/index.html

    I highly recommend going through the tutorial first before you look at my code, unless you've already done some cocoa/objective-c stuff before. I've been screwing with it for about 24 hours now and i'm just starting to grasp the syntax and everything.
     
    Last edited: Nov 3, 2005
  2. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM

    :hsugh:

    You enter the size of your tank.. how much gas is in your tank (using the slider), the price of gas and it tells you how much it'll cost you to fill up your tank :o
     
  3. urban ape

    urban ape take that take that take that

    Joined:
    Aug 22, 2003
    Messages:
    9,220
    Likes Received:
    0
    Location:
    League City, Texas
    hey thats pretty cool. i think it would make a good widget
     
  4. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM

    :o

    It's not really something people would use, just something to help me learn how to use Cocoa. It's just a bitch learning the syntax of Objective-C :sad2:
     
  5. tenplanescrashing

    tenplanescrashing Active Member

    Joined:
    Jan 9, 2005
    Messages:
    9,287
    Likes Received:
    0
    any way you could host the xcode project? i'd like to see one as a starting point for learning xcode.
     
  6. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM

    no problem:

    http://www.brandonobrien.com/random/GasCalculator.zip

    This is what I used to make my first Cocoa app... it's pretty good for beginners and shows you how to make an interface and how it interacts with the code:
    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/index.html

    I highly recommend going through the tutorial first before you look at my code, unless you've already done some cocoa/objective-c stuff before. I've been screwing with it for about 24 hours now and i'm just starting to grasp the syntax and everything.
     
  7. Icedog

    Icedog New Member

    Joined:
    Oct 3, 2003
    Messages:
    8,100
    Likes Received:
    0
    Location:
    CO
    any way to make that into a widget?
     
  8. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM

    I'm not sure, i might work on that. Widgets are mostly javascript though... so i'd have to recode the whole thing using javascript :dunno:
     
  9. tenplanescrashing

    tenplanescrashing Active Member

    Joined:
    Jan 9, 2005
    Messages:
    9,287
    Likes Received:
    0
    someone else on here made a widget, ask them if they could make it.
     
  10. beaker

    beaker New Member

    Joined:
    Sep 14, 2002
    Messages:
    2,408
    Likes Received:
    0
    Location:
    Edmonton
    i've made a widget.

    einstein quote FTW.

    but i dont know about this one
     
  11. urban ape

    urban ape take that take that take that

    Joined:
    Aug 22, 2003
    Messages:
    9,220
    Likes Received:
    0
    Location:
    League City, Texas
    are you serious? my fucking little cousin walks around repeating those quotes :hsugh:
     
  12. colosodian

    colosodian Next Gen

    Joined:
    Oct 16, 2004
    Messages:
    1,110
    Likes Received:
    0
    Location:
    SF Bay
    I think I might adapt this so that you enter how many miles youve driven on the current tank, and your typical mileage.

    Do you mind?
     
  13. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM

    go for it, that's why i posted the project file :o
     

Share This Page