Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Greencardman

macrumors 6502
Original poster
Apr 24, 2003
490
2
Madison, WI
What are some useful resources for learning Xcode and/or Git? Any book recommendations?

We use an open source back-end to produce our magazine and I've self-taught myself enough programming to get by and get our app in the App Store. I have trouble understanding what everything does in Xcode and I mess up often, which breaks our app, so I'm terribly afraid of touching things.

I also make little changes to the code here and there, like adding analytics, and then a new version of the open source code comes out and I have to go over my old code line by line to find out where I should copy and paste the bits that I added. This is unsustainable, so I'd like to learn how to manage my code so that I can merge two files, again, without breaking our app.

I don't need any books on programming, just Xcode and how things work. So what have you guys found useful?
 
Care to elaborate as to why you think Xcode's built-in source control is a PITA and how gitflow helps?

I've had huge issues with Xcode in the past. It used to lose code whenever you changed a branch or created a new one. For small projects it may not be a big hassle, but for larger projects, a few missing lines can lead to big problems. Also, it used to crash many times while auto-merging.

Git flow is just an alternate git branching model. In git flow, there are only two branches in your repo: one on which you do your regular development (develop) and the other which only contains stable code (master). When you start working on a new feature, you create a new branch for it based on the develop branch. After you are done with the feature, you commit your changes and merge the branch into develop. And when you have release worthy code, you merge the master and develop branches.

Other than these there are also hot fix branches and release branches. The main advantage is that implementing a new feature does not break other things. It also becomes easy to track which feature was implemented in which commit and dig out the code for a specific release.

You can read more here:
http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
 
I'm very frustrated with Xcode's documentation right now. For a beginner, its kind of confusing. I need to merge two documents, neither one of which I coded. When it puts them up on the screen side by side, I don't even know which one is which. How do I pick the lines I want to keep or the ones I want to remain the same. Am I just not getting the concept here?
 
I'm very frustrated with Xcode's documentation right now. For a beginner, its kind of confusing. I need to merge two documents, neither one of which I coded. When it puts them up on the screen side by side, I don't even know which one is which. How do I pick the lines I want to keep or the ones I want to remain the same. Am I just not getting the concept here?


Learn git outside of Xcode first. I would recommend code school or the tutorial on Github. Do not learn git via any type of UI or it will seem awkward. Then come back to Xcode and try it again. I learned git before Xcode supported it and found it an easy transition.


I don't even know which one is which. How do I pick the lines I want to keep or the ones I want to remain the same. Am I just not getting the concept here?

On a conflict or a regular commit? If it's a regular commit you select the files to commit on the left vertical bar. If you want to discard specific lines you do so with the numbered buttons located in the vertical bar that separates the left document (which reflects the changes you have made since the last commit) and right document (reflects the document at the last commit).
Hope this helps.
 
I have trouble understanding what everything does in Xcode and I mess up often, which breaks our app, so I'm terribly afraid of touching things.

A good investment here might be to read up about how to write tests for your application. The app I'm working on has a "model" component which is somewhat involved mathematically and very core to the application. One way I worked around the same concerns you mention was to write exhaustive unit tests to ensure that any change I makes preserves the important properties / requirements of those classes. On a higher level, I would assume that you can also write automated front-end tests where you could basically specify an entire user workflow, and have the test walk through it step by step. This is another good way to ensure that changes you make don't present any regressions in functionality. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.