What should I do with this dead code?

Discussion in 'Mac Programming' started by moonman239, May 29, 2015.

  1. moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #1
    So I have a view controller in my storyboard that is no longer useful. I have some associated subclass files that I also want to keep.

    Come to think of it, I know when you press "delete" while a file is selected, you can choose between moving the file to Trash and simply removing the reference. I'll remove the references to the subclass files, but what about the storyboard view controller? I don't want it in my binary, but I do want it in my storyboard so that I don't have to go back and re-add it if my clients decide they want what that view controller offers.
     
  2. zeppenwolf macrumors regular

    zeppenwolf

    Joined:
    Nov 17, 2009
    #2
    It seems that you have no experience with Version Control... ?

    Google / investigate "git", which is a Version Control System fully integrated in Xcode. Normally, it's a command line interface, but I would also recommend that you download "GitX", which is a separate standalone application to wrapper git commands.

    Git, and version control in general, can be quite involved, when you have multiple users working on the same project in different places, etc... But from the sounds of it, you will have no need for that stuff-- your needs are the most basic possible, so what you need to know is also just the most basic, so... like I said, just look into git, familiarize yourself with GitX and use it enough to prove to yourself that you can reconstitute earlier versions, extract earlier versions of specific files, etc.

    Don't forget to backup the git repository itself. If that statement doesn't make sense right now, it will after you've looked at git.
     
  3. moonman239 thread starter macrumors 68000

    Joined:
    Mar 27, 2009
    #3
    Yes. I do have a git repository set up for this app. I make commits every now and then.

    With git, I can easily restore any commit I want, right?
     
  4. zeppenwolf macrumors regular

    zeppenwolf

    Joined:
    Nov 17, 2009
    #4
    Yes, to commit a file means that you can then retrieve it exactly as it was at that moment... that's the theory. In the real world, where you're making "commits every now and then" but you haven't really *used* git before, your first step is to completely back up your entire project folder, and then experiment with git. In particular, removing all of the files in your project folder, retrieving them all with git, and confirming that your xcode project is fully reconstituted. Actually, that's second-- first, read at least some of the documentation, and pay attention to where the git repository is stored, ( usually in /MyKillerApp/.git )
     

Share This Page