r/simpleios • • Nov 16 '11

Request for: A getting started guide

Hi,

I love this subreddit and have decided to dedicate my summer holidays to learning to code for iPhone. I have zero coding experience, so a guide with the order to go through resources would be very handy. Perhaps the post owner could update it if major changes occur.

I tried following an example tutorial, but there seem to have been quite a few changes to xcode.

I'd certainly appreciate if someone with experience could do this and I think many others would benefit too.

Of course it would also allow the level and amount of knowledge in this subreddit to grow and can only make it stronger.

Thanks

11 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/newbill123 Nov 16 '11

Why You Might Want to Use Git In Xcode:

Most extended examples work through code. Telling you to add things in little parts. They tell you to break things ("Now that this is working, let's see what happens when we...") They take things you did in old projects you got working in other parts and gut them for use with a new example.

But what if you want to be able to turn back the clock and go back to what you did previously? Version control is a good reason. But you aren't going to want to learn the ins and outs just yet. Here's a brief primer with Xcode.

  1. Choose to create your project with a Git repository.
  2. Commit the project by typing Command+Option+C (or by choosing File > Source Control > Commit... from the menus)
  3. Ignore whats in the main part of the window and at the bottom "Commit Area" type a message like "The pristine state".

Now whenever you want to save an important state of things, you can just commit. Let's say you type a hello world example and it works. But then the author says "Now let's try...", this would be a good place to commit what you have.

  1. Commit the project by typing Command+Option+C (or by choosing File > Source Control > Commit... from the menus)
  2. LOOK! It's showing you what changes you have made with nice bezier curves and highlight areas (rather than ugly unified diffs). This is great for spotting inadvertent changes.
  3. You still need to write a commit message ("finished hello world example") and press the commit button.

If later you want to compare an two older versions, you can do that.

Open up the "Version editor" and it will show source code on two side by side panes (you may need to hide the utility view for this to be helpfully wide).

2. There is a Time Machine like icon at the bottom of the divider between these two panes. Click it.

3. Lines appear with each one representing a commit. Hover over it to read the commit message and see when it was committed.

4. Adjust the arrows to the side of the lines to compare two revisions. Let's say the bottom left is pointing to local and you move the right one back to pristine state. It will show you the changes between those two states with those nice bezier curves and highlighting.

That just barely scrapes the surface of why version control is a good thing to someone working solo (and a must have for people working in groups). But even for a very beginner, it's a good tool to have in your toolbox.