Just started developing Apps (square one)

Discussion in 'iOS Programming' started by theDionysianOne, Apr 20, 2012.

  1. theDionysianOne macrumors newbie

    Joined:
    Feb 18, 2012
    #1
    So, I've decided to take the plunge and teach myself (with whatever tools I can find) how to develop apps. How? Why with Steve Jobs' CAN DO, & YOU WONT STOP ME attitude. When it comes right down to ANYTHING, well, it just takes a will to learn, and the patience to go through with it.

    So, having said that, this is freaking hard. First off, I know nothing about C language. Also am not familiar at all with programming anything. But, I'm damn good at solving problems, and using logic. I mean real life logic.

    But, I think my main problem is that I've started out with Xcode 4.3.2 instead of the versions that are in all the instruction books and guides I've found. They apparently went through some major layout changes, as well as verbiage changes. For example, the book I was using (don't laugh) - the Complete Idiots Guide to developing iPhone and iPad apps, uses folder names like "Classes, Other Sources, Resources" but in 4.3.2 they're called "whatever you named your app, Supporting Files, whatever you named your app+Tests." I think.

    Either way, it's not very accurate. I was able to create two and a half apps per their direction, but was unsuccessful at creating buttons and linking up their actions using outputs. The verbiage has changed, the layout has changed compared to my book.

    Anyway, does anyone know of an up to date guide that has a similar function to the "complete idiot's guide" or "for dummies" type of execution. I'm not completely stupid, I just think they're useful for easing into the natural flow of learning something.

    Help!?!
     
  2. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #2
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    You should definitely learn some C first, I think.

    I'm refreshing myself on C right now using a free website full of tutorials:

    http://c.learncodethehardway.org/book/

    Thus far, I've gotten past exercise 5. Haven't learned much C yet (I already knew everything so far,) but I've learned a good deal about using terminal and programming without a development environment. I like the book.

    Just looking at the Exercise titles, I think you need to know at least everything up to and including 14: Writing and Using Functions.

    Once you get that much C under your belt, move over to Stanford's free iOS programming courses. They'll teach you obj-C, Xcode, and the iOS SDK.
     
  4. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #4
    I have decided after struggling with a simple, "Hello world", app in Xcode - I am going to learn some C first. Apple said it is not really necessary to learn C - but I figured that if I understood more of the code, I could easily fix, make and debug APPs.

    Thank you for the website - I will also be following your advice. :cool:

    I will go up to exercise 14 - then move to Stanford's website for the iOS SDk's and so one.
     
  5. manPrime macrumors newbie

    Joined:
    Apr 21, 2012
    #5
    I'm in the same boat as you but found Programming in Objective-C by Stephen Kochan to be a really good place to start learning. I would suggest picking it up
     
  6. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #6
    I did exactly what manPrime said but found the learning curve to hard. I stepped back into C to learn the basics first. Then when I stepped back in to Objective - C it was not such a steep learning curve for me. I liked and read "Learn C on the Mac". It was a very good easy to follow book.
     
  7. manPrime macrumors newbie

    Joined:
    Apr 21, 2012
    #7
    Actually thinking about it i read the first few chapters of Aaron Hillegass's Obj-C book before Stephen's, which starts off with C, however i found it a bit strange learning C to then just 'unlearn' certain parts of it, but thats just my opinion.
     
  8. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #8
    Would you guys say that its harder to learn Object-C first - or C first?

    I want to get the basics down of C as I believe it will really help my understanding of the Object-C language - and so what if I have to "rethink" the way C works, if starting from the bottom help more?

    I am going to try learn C, then Object-C and move onto the iOS side of things.
     
  9. CheesePuff macrumors 6502

    Joined:
    Sep 3, 2008
    Location:
    Southwest Florida, USA
    #9
    I highly recommend Programming in Objective-C 4th edition. It's mean for someone with no real programming experience. Then once comfortable, get iOS Programming, Big Nerd Ranch Guide 3rd edition and/or watch the Stanford videos on iTunes U.
     
  10. MattInOz macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #10
    Id say before you start read about object oriented vs procedural programming just in general even if just on wiki. Then think about the way you solve problems and apply logic. One of them will jump out at you as feeling more natural.

    If your an object thinker have then just jump in to Kochan programming in objective c book. This book will teach you enough C to get started then move to a good foundation of objective c. From there you can then have a serious crack at something like big nerd ranch iOS book. Sure you'll get to a point you know that your writing ugly code and need to know c a lot better, then you swing back to Kochan programming in C. If your procedural start with c then move on.

    Either way there will be lots of reading, lots of practice and lots of fun.
     
  11. theDionysianOne thread starter macrumors newbie

    Joined:
    Feb 18, 2012
    #11
    Wait, do what now?...

    I started reading the "learn code the hard way" web page. Right out of the gate I'm not clear what it's asking me to do:

    "1.4 Text Editor

    The choice of text editor for a programmer is a tough one. For beginners I tell them to just use Gedit since it's simple and works for code. However, it doesn't work in certain internationalized situations, and chances are you already have a favorite text editor if you've been programming for a while.

    With this in mind, I want you to try out a few of the standard programmer text editors for your platform and then stick with the one that you like best. If you've been using GEdit and like it then stick with it. If you want to try something different, then try it out real quick and pick one.

    The most important thing is do not get stuck picking the perfect editor. Text editors all just kind of suck in odd ways. Just pick one, stick with it, and if you find something else you like try it out. Don't spend days on end configuring it and making it perfect.

    Some text editors to try out are:

    Gedit on Linux and OSX.
    TextWrangler on OSX.
    Nano which runs in Terminal and works nearly everywhere.
    Emacs and Emacs for OSX. Be prepared to do some learning though.
    Vim and MacVim"


    So, okay, I got gedit. Fine. But then the very next thing in the instructions is:

    "Exercise 1: Dust Off That Compiler

    Here is a simple first program you can make in C:

    Source 3: ex1.c
    1 int main()
    2 {
    3 puts("Hello world.");
    4
    5 return 0;
    6 }

    You can put this into a ex1.c (wait, do what now?) then type:

    Source 4: Building ex1
    1$ make ex1
    2cc ex1.c -o ex1

    Your computer may use a slightly different command, but the end result should be a file named ex1 that you can run."


    Is it not obvious that the author skipped something? I've installed gedit. Then he's just like, "now put this into a ex1.c" without telling me what/where I'm supposed to do this? Not very clear instruction. That'd be like telling someone that's never operated a car to just go drive to the store. "You just get in and go." Yeah, I get that, but once I'm in the car what do I do? "Uh, duh, you accelerate." Okay, how? Don't you see that you've skipped the part where you turn on the car and put it in gear etc etc?

    I tried just opening gedit and typing:
    int main()
    {
    puts("Hello world.");

    return 0;
    }

    Then trying to maybe save it as a ex1.c but this is obviously NOT what the author meant because that's not what I'm supposed to be doing.

    I'm starting to think that maybe instead of making money off of app development, maybe I should just write a REAL guide to this stuff.
     
  12. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #12
    Actually, that is exactly what you're supposed to do. Save the file as ex1.c (don't forget the extension or the next step won't work.)

    I'm pretty sure somewhere before this he explained that Terminal is an app already installed on every Mac.

    Yes, right here is a quote from Exercise 0: The Setup, section 1.2 Mac OSX:
    The author is very concise. Rereading some sections may be necessary.

    Anyways, I'll elaborate a little bit on what your should do...

    Create a file for storing everything you'll be doing from this book. I suggest not placing it in a deeply buried place, or else finding it by typing out the path will be a pain.

    Now save ex1.c (don't forget to write the c yourself in the file name,) in that folder.

    Launch Terminal. By default, it's installed in Applications > Utilities. Spotlight should reveal where it is if it has been moved for some reason.

    Now, it'll print some garbage, and then a $. The $ indicates that it's done with whatever and awaiting your input. Next, you need to navigate into the folder I told you to create earlier, in Terminal. Here are the commands you'll need (which the author doesn't explain at all, I had to ask for help to get these commands,)

    type "ls" (that's the letters ell and ess) and return. This will list all of the folders you can go to.
    type "cd <folder>" to have Terminal go into the folder.
    type "cd .." to back out one level from the folder you're currently in.
    type "cd /<path>" to just specify the entire path to a folder yourself, instead of going from whichever folder Terminal is already in.

    Also, whenever you're typing a folder name, hit the tab key to have Terminal auto type some of the name for you. Just a handy hint, as it lets you know you're typing the name correctly thus far.

    Now, for the part you're at right now,

    The 1 and 2 are just line numbers. Ignore those. The author is substituting all the crap terminal prints on its own with just a $. Type in "make ex1" and press return as soon as Terminal gives you a $ once you've navigated to the correct directory. Everything on line 2 is what terminal will automatically print.

    Similarly,

    Type in "./ex1" as soon as Terminal gives you another $ (indicator that it's awaiting input.) This tells it to run the program ex1. The program, which you wrote yourself, just tells it to print out "Hello world.", and so it does that, and then it's done and gives another $ indicating it's ready for your input again. Celebrate, you wrote your first C program once you see it.

    You could make it easy, but it'd be misleading. Programming requires independent research. You're going to get confused and you're going to have to ask questions (kudos on asking here now instead of just giving up.) Sure, you could make learning C easy, but then it comes time to learn a new language. Depending on how new (or how much English the author knows,) the documentation could be poor.

    Having said that... I do consider writing my own programming book sometimes... something that goes from "I know absolutely nothing" to "I can do anything with C or Obj-C or Cocoa or Cocoa Touch".
     
  13. theDionysianOne, Apr 22, 2012
    Last edited by a moderator: Apr 22, 2012

    theDionysianOne thread starter macrumors newbie

    Joined:
    Feb 18, 2012
    #13
    Okay, I've saved the whole:
    Code:
    int main()
    {
         puts("Hello world.");
    
         return 0;
    }
    
    as ex1.c into a folder on my desktop and named the folder Coding. That's all well and good. I was able to navigate (in the Terminal) into the folder I made just fine. But as for typing: make ex1

    Nothing happens. It just says:
    -bash: make: command not found
     
  14. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #14
    I did not have this issue... I googled a little bit, and it looks like you need to have Xcode installed on your machine...

    There are a variety of ways of getting Xcode... off the top of my head these are the possibilities:
    1 - If you have a copy of the DVD for OS X (either Leopard or Snow Leopard,) it's an optional install included on the disk.
    2 - It can be bought and downloaded on the Mac App Store for $5, if you're running Snow Leopard or Lion.
    3 - It can be downloaded from Apple's developer portal somewhere... I don't know if you need to have a paid membership or a free one is adequate to download Xcode.

    You're going to need Xcode eventually anyways, as it's necessary for writing apps for iOS.
     
  15. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #15
    You can also install a compiler and build environment without Xcode from various places like:

    http://hpc.sourceforge.net/

    I'd definitely recommend a real book (over a website like Learn Code the Hard Way) to use, preferably one which is a "standard". At least others can check out the site to help you....

    B
     
  16. theDionysianOne thread starter macrumors newbie

    Joined:
    Feb 18, 2012
    #16
    It's been installed on my iMac this whole time. Is there some communication I've missed here? Should I be doing this in Xcode? I thought that was for making apps? Should I be typing all of this into Xcode instead of gedit or the terminal?

    ----------

    Do you have a recommendation? What would be considered a "standard?"
     
  17. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #17
    You may need to install "Command Line Tools for Xcode" then.

    e.g. http://kennethreitz.com/xcode-gcc-and-homebrew.html

    B

    ----------

    For Mac/OS X development the Objective C books by Kochan and Hillegass that have been mentioned are the most common. Many will already be familiar with the material so it helps us help you. Both have been upgraded for Xcode 4.

    If you do feel like you need more C than either of those books provide Kernighan and Richie is the standard book, but it is too terse for many people. "Learn C on the Mac" is a more approachable book which was successful for user larswik.

    B
     
  18. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #18
    You could. To be honest, that is how I started. I've heard from lots of people that it's a poor way to start on account of it then being too automatic and there not being enough understanding of how it all works.
     
  19. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #19
    I started with "Learn C on the Mac". Get it on paperback or an iPad version which is what I did. I read it real slow over 3 months and doing my own tutorials for each section so I understood it. After that it made stepping into Object - C much easier.

    I don't really get how Apple can say you don't need to learn C first? C is the first floor of my house. Object C is the second floor.

    My advice. Learn C. Forget about pretty graphics and learn the logic first. When you are done with the book make a console based BlackJack game that works with A's as 11 or 1's. For me that was a task and when I was done I stepped into Objective - C.
     
  20. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #20
    Totally agree with you there.

    I am reading that same book (4th edition) and find it very helpful and find that I am actually getting this stuff and understanding it. By the end of chapter six - I am able to write my own small program based on the topics covered so far. :cool:

    But I am going to re-read the l5th chapter as I didn't understand fully about the "--, -=" and "++" operators.

    Apple have it wrong if they think you can just jump to Objective-C - :eek:
     
  21. JonMcDonald, Apr 22, 2012
    Last edited: Apr 22, 2012

    JonMcDonald macrumors member

    Joined:
    Jan 18, 2009
    #21
    As a CS student I know exactly what you are going through. However, take this tidbit of advice for what it is worth: don't focus so much on the actual code syntax. Pick up things such as design patterns, and algorithms. I would probably pick up a couple books, one maybe on C or Objective C (I'd probably just go with Objective C, as object oriented programming is REALLY popular). Here's a good Objective C book that I read and really helped me: http://www.amazon.com/Programming-O...1909/ref=sr_1_1?ie=UTF8&qid=1335159256&sr=8-1.

    Then pick up a second book on either design patterns, or algorithms. Once you have these two books read and you actually understand the content, pick up a book on good iPhone app development.

    Since you are a fan of Steve Jobs, then I'm sure you know that Steve was also a fan of not taking short cuts but instead do it the right way. Produce quality, extendable, modifiable, relatively bug free code and reap the rewards that a well built app will truly bring.
     
  22. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #22
    Its a great book. I was not smart enough to start with Object C, to much and it was confusing. Once I grasped C, the transition was less painful.

    If you like that book and you think the next one in the series would be good, don't do it. It is written by a different author and is not nearly as good as the one you are reading now. There are other good options.

    Continuing to learn I am reading through a book called "Clean Code" to help me develop better coding habits and styles.

    I found so for that programming is something you never master, you just get better and better at it the more you work with it.
     
  23. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #23
    Different strokes for different folks.

    I'm of the camp that believes that many people can go straight to Obj-C with either Kochan or Hillegass because of the unlearning aspect manPrime mentioned.

    One disadvantage of Obj-C being a strict superset of C is that you can be tempted to implement something as you might in C even if there is a much simpler/clearer way to do it using a framework.

    B
     
  24. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #24
    One disadvantage of Obj-C being a strict superset of C is that programmers are tempted to implement something using Objective C frameworks even when it would be simpler, faster and more energy efficient to do it using plain C and/or C data types.

    The downside of some of these Obj-C books is that the authors don't clearly explain the advantages and disadvantages of each language subset, allowing their readers to be better able to choose which Obj-C subset might be more appropriate for a particular coding problem.
     
  25. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #25
    Clearly. There's a tension there otherwise there would be no dilemma.

    And you know I don't advocate NOT learning C, or even ASM if you have to/want to, but a newbie is more likely to write clean readable, maintainable code in Cocoa than straight C.

    I hate looking like I'm picking on larswik, but I think this is a concrete example of what I'm referring to: http://forums.macrumors.com/showthread.php?t=1212054

    It all depends on the person though. Some will resonate with C others Obj-C, some neither. It will also depend on the book/teacher/website.

    B
     

Share This Page