Results 1 to 14 of 14
  1. #1
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    Programming in C
    I bought the book C for Dummies (its the desk reference that is like 800 pages thick and has like 7 books in 1) I am beginning to learn C. However, when I mean beginning, i mean THE VERY BEGINNING. All I know so far is a couple lines of code that I put in TextEdit and saved it as a .C file The author talks about compiling it and some command but I have no idea how to turn the code into an application!! CAN SOMEONE PLEASE HELP!

    also when i saved the textedit file as a .C file, it now opens in XCode.

    so yea once again I dont know how to Compile my C Code into an app please help!

    THANKS IN ADVANCE.

  2. #2
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    Developing an iPhone/iPod Touch App.
    Hi i have a huge desire to create my own game on and iPod Touch and get it in the app store. I already downloaded iPhone SDK. Can someone please explain to me exactly what Objective C is (i think is a language but i am not sure) and exactly what Cocoa is.(i have not idea what cocoa is...) Someone told me i needed to learn both of those to make an app but I need to know what they are, and some book/website recommendations of how to learn them. I AM A COMPLETE BEGINNER WITH NO CODING/DEVELOPING/PROGRAMMING EXPERIENCE AT ALL! I DO HOWEVER KNOW HOW TO USE A MAC BECAUSE I HAVE BEEN FOR 3 YEARS.

  3. #3
    Programming in C
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,188
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    Objective-C is indeed a language, it adds OOP (Object Oriented Programming) mechanics to C and is the chosen language for programming on the Mac.

    Cocoa is the framework provided by Apple to program applications on the Mac, a version of this framework has been created for the iPod Touch/iPhone called Cocoa Touch.

    To develop native applications on the iPod/iPhone that are not gaming related you need to learn Obj-C and the Cocoa Touch framework and use the various interfaces provided to you.

    The moment you say you want to do a game, you need to being OpenGL and OpenAL into the picture and these are the graphics and audio frameworks respectively.

    There are some alternates to dealing with OpenGL (or at least limiting how much you use it) by using things like cocos2d which is a gaming framework that allows you to get going quickly.

    YOu will want to take a look at these 2 books, they deal with learning Objective-C and the iPhone SDK.

    Amazon.com: Programming in Objective-C 2.0 (2nd Edition) (9780321566157): Stephen G. Kochan: Books
    Amazon.com: Beginning iPhone Development: Exploring the iPhone SDK (9781430216261): Dave Mark, Jeff LaMarche: Books

    Now if you have no coding experience at all, do it the right way by first learning the language and then the SDK and go from there. Expect to spend minimally 3-6 months to get fully comfortable with Obj-C and another 2-4 months with the SDK..

    Regards

  4. #4
    Programming in C
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Raz0rEdge,

    I think it would have been better to say that Objective-C is a superset of C, since anything you can do in C, you can do in Objective-C. Your response in the other thread is a better one.

    I mentioned this here for future readers who might get the idea that Objective-C excludes the capabilities of C, which I think your answer may give some readers.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  5. #5
    Programming in C
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,188
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    @xstep, you are correct sir..C < (Obj-C | C++)...the geek in me..

    @Macman95; In XCode, File->New Project. Choose Application and then Command Line Tool. In the Type choose C, then hit Choose and create a name..

    This will create a simple C project that you can immediately build and run. You can then modify it further..

    Regards

  6. #6
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    ok Raz0rEdge, i went to XCode, i did File->New Project. I chose MacOSX (not iPhone OS) then I chose Application. After application, there were a bunch of different types of applications like Cocoa, Carbon, and all these others but i didnt see Command Line Tool. Can u help? am i in the right spot?

    wait i think i found it. my XCode must be different from yours because mine was under Command Line Utilites, not Applications. okay now i have it but i dont know where to type in my code.

  7. #7
    Programming in C
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I, now, agree with the OP, the threads are not duplicates. One is about working with C, while the other one is a general question regarding iPhone development. The OP says he edited one of his original posts and I recall thinking that they were close enough to being to duplicates. Anyway...

    I looked up that book Macman95 mentions, via Amazon, and found a review that says it is Windows slanted. This could cause issues with using it on other systems such as OS X, Linux, Sun OS, etc. It is best to buy books targeted at your platform. The books Raz0rEdge mentions are such books. Check Amazon for Cocoa programming books.

    I agree with Raz0rEdge that for a newbie it will take some time to learn both Objective-C and then the frameworks. There is no shortcut, but some people do learn faster than others. Designing applications is the other half of the equation that is a difficult process too. Perhaps keep this link in mind; Book Review: Cocoa Design Patterns.

    I disagree that OpenGL is required for a game. That is too broad a statement. To keep it simple, Tic-Tac-Toe would not require OpenGL, although it might be neat to use for some cool factor. Ditto for OpenAL.

    Macman95, you may want to look at resources such as BecomeAnXcoder and CocoaDevCentral. As you go forward, you'll want to get a free membership to the Apple developer programs.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  8. #8
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    ok can someone please please please tell me exactly what programs i need to write the code for C and then compile it into an app???? this is extremely frusterating!!!!!
    i know how to write a couple lines of a basic app in C but everyone is telling me mixed info!!! am i supposed to use TextEdit? XCode? Where do i get a Compiler? what is Terminal??? OMGOM!?!?!!??? PLEASE HELP

  9. #9
    Programming in C
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,188
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    @Macman95, sorry I should have mentioned that I'm using SL with the latest XCode, so things might be moved around a little bit..

    I'm at work, so bare with me as I guess a little bit..but in the left frame you should see various files that you can modify with a .c extension? Clicking on it should reveal the basic C code that's there, you can modify that for a start.

    I will have to get home and take a look at this to provide a more detailed answer..

    Regards

  10. #10
    Programming in C
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    For the 'Command Line Utility', choose 'Standard Tool'. Look in the 'Source' tab and you'll see main.c where double clicking that opens the file in an editor.

    To add a new source file, from the menu choose File-->'New File...'. Under 'Mac OS X', choose 'C and C++', and then 'C File' or 'Header File' if appropriate. The file(s) will be created into your Resources folder of your project.

    To learn more about XCode, from the menu choose Help-->Documentation.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  11. #11
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    ok xstep i found the main.c but it already has code in it, where do i write my own code?

    also, what is a source file?
    lastly, how do i compile my code after i write it?

  12. #12
    Programming in C
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    XCode has it's own editor with benefits over TextEdit. I would recommend using the XCode editor.

    You say you have installed XCode, so you have the C compiler already installed.

    Look under XCode's 'Build' menu for building and running code. As an alternative, you can use Terminal by setting your folder location and executing C build commands. This 'C Tutorial for Cocoa' discusses shows some of the compiler commands. You'll have to look for some Terminal reference since I don't know of any. To change directories you use the cd command. Open Terminal, in the Utilities folder, and type 'man cd' without the quotes. man is the command used to get help on other commands.

    Type the following into Google to find some help on learning to use Terminal

    "OS X" learning to use terminal

    You are getting frustrated because you are piling on a lot of things in a jumbled manner. It would be best to take a course or find a book for that can guide you.

    I just found Masters of the Void. It is something you should look at. I found it by typing the following into Google;

    learning to use XCode for C
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  13. #13
    Programming in C
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    A source file is a file with code in it. XCode created one for you called main.c. You can remove all the code in it and replace it with your content. It is called source because that is the source material the compiler will use to build your running application.

    Read some of the links I've given you for your other answers.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  14. #14
    Programming in C

    Member Since
    Oct 14, 2009
    Posts
    7
    Specs:
    MacBook, Orange-Clip iPod Shuffle
    ok so I was using my C for dummies book and trying the code in xcode and i was getting all sorts of error message and i was getting frusterated.
    finally, i decided to use the Masters of the Void link, and 5 minutes into it... everything started working! thanks for help
    im going to use my book only to teach me the language, but do format it and use things in xcode im gonna use the Void tutorial. thanks

    i will post any further troubles or questions i have in this forum

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 05-29-2012, 05:32 PM
  2. Programming
    By Jonablink23 in forum iOS Development
    Replies: 1
    Last Post: 10-20-2011, 02:50 PM
  3. c++ programming help!
    By ji4o90d in forum OS X - Operating System
    Replies: 3
    Last Post: 10-17-2011, 08:27 PM
  4. C programming
    By juco in forum OS X - Apps and Games
    Replies: 6
    Last Post: 05-19-2006, 06:52 PM
  5. programming
    By kakosc in forum Schweb's Lounge
    Replies: 6
    Last Post: 01-09-2004, 11:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •