Duplicating a Project

Discussion in 'Mac Programming' started by larswik, Jul 11, 2011.

  1. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #1
    I just finished my Experience Point Calculator for gaming (with much help from this board). I want to go through and clean up code and maybe add a few things but I don't want to mess with the original project.

    Whats the best way of duplicating a project? I ask because I know there is the source folder that I copy things into and I don't know if those things will get duplicated too.

    Is there a standard way of making a copy of the whole project and renaming it version 2 for instance?

    -Lars
     
  2. PatrickCocoa macrumors 6502a

    Joined:
    Dec 2, 2008
    #2
    Again with the file system, oy!

    Again you're going to the file system as your default method of interacting with your data. In this case you have Xcode, think of Xcode as an umbrella that controls your data - pretend you can't see your files. Xcode unfortunately doesn't have a "duplicate project" command that I'm aware of.

    But Xcode does have access to source control methods, like Git and Subversion. Both of those will do what you want. Unfortunately, learning either of those is too big of a topic for right now, although you'll want to learn one or the other at some point.

    So I'm back to using the file system to duplicate the project. Find the folder that contains the (projectname).xcodeproj file. Duplicate that folder, go in and change the file name of the duplicated (projectname).xcodeproj file. Then open that new .xcodeproj in Xcode. And hope that you didn't have any indirect references to files in your original project.
     
  3. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #3
    Thanks Patrick, that is what I was thinking. I was not sure so I thought I would ask first before I duplicated the folder and renamed the project file. With more everything else I work with I save other versions to be safe. I did not now if there was a proper way so I thought I would be safe and ask.

    Thanks!

    -Lars
     
  4. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5)

    I would just like to echo PatrickCocoa's point in the middle of his post.

    Get with SVN or Git earlier rather than later. Make it part of your workflow even for the simple stuff, so that when things aren't so simple you already have experience and "good habits".

    B
     
  5. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #5
    I have seen "SVN or Git" but I don't even know what they are yet in my learning curve. Learning C was a piece of cake compared to Object- C. Not because its easier, but because Object-C is so much bigger. I think Jim said something like you don't learn the whole thing but you can look everything up. Right now I am just trying to do repetitive stuff so what I learned so far sinks in.

    I think in order to be really good at Objective - C you need to have a full time job doing it.

    I am looking forward to my Java Class at City collage next semester. Pascal was a nice structured learning environment. Self learning is kind of random.

    -Lars
     
  6. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #6
    SVN or Git is basically Time Machine on steroids for code projects (or pretty much anything else that is largely text files).

    Both integrate in quite easily into Xcode so they integrate easily into your workflow.

    EDIT: Here's some documentation from the Xcode Users Guide http://developer.apple.com/library/....html#//apple_ref/doc/uid/TP40010215-CH7-SW12 and a link to a hosted SVN/Git provider I use myself. http://beanstalkapp.com

    I think you are referring to the anecdote I posted again recently here: http://forums.macrumors.com/showpost.php?p=12883802&postcount=12

    I still think it bears repeating:

    All the best with your free-code and getting back into more structured work at CC in the fall.

    B
     
  7. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #7
    haha... It was you and not Jim that said it, my bad :) I know you don't remember cocoa but you look it up, but first you need to know what to look up. So I guess you can learn it and then forget it as long as you remember there was some code snippet out there to make your life easier.

    2 days ago I was struggling with the fact that I could not make a second window pop up by pressing a button on the first window. I was control dragging from the window and I was getting an UBOutlet for NSView. I had no idea that there was a difference between control dragging the window and the bar above the window to get an NSWindow and not NSView. Now I know.

    I'm thinking of getting this book http://www.amazon.com/Cocoa-Recipes-Mac-OS-X/dp/0201878011 It seems to guide you through a large project and not small tutorials. But everything is Xcode 3 still.

    I Learn a little every day.

    -Lars
     
  8. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #8
    You want the 2nd edition. http://www.amazon.com/Cocoa-Recipes-Mac-OS-2nd/dp/0321670418.

    I read through this book for the same reason of having one project which evolves. Although, I would take book with a grain of salt. I can't remember specifics, but I do remember deviating from what the book did, because I didn't think it was right to do it that way.
     
  9. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #9
    Thanks. I downloaded the 2nd Edition for the kindel app on my iPad. I am going to finish the Objective - C for Absolute beginners first then start on it. I hope I can covert from their Xcode 3 examples to Xcode 4 easily. I never used interface builder in version 3, I was just writing console based stuff. I only got GUI a couple weeks ago in version 4.

    -Lars
     

Share This Page