Something bad happened to my sprite kit project. I was working on my first ios game, and I've got most of it done. But then today, I somehow see that my game scene swift file was gone. There is no way that I can open or have the file back on the project again. The file marked in red in the picture is the missing file.
Screen Shot of Xcode project
Some one Please Help!
Time Machine
Use Time Machine (use Spotlight Search) to go back in time to when it wasn't deleted.
Source Control
If created, go into your source control provider (XCode, BitBucket, GitHub, etc) and make a pull request from a previous commit.
Snapshots
If you snapshotted the project, go back through them to find when it wasn't deleted.
Finder
Check all the files inside of where you saved the file. It is possible you only removed the reference of the file and not deleted it. Use spotlight search if necessary. Check the Trash bin on Mac.
Tips For Future Projects
Use source control, such as ButBucket or GitHub. XCode has a built in one as well. You can also use Time Machine, a built-in app that captures everything on your mac every couple of hours so you can go back in time and pull anything you need back (even trashed items).
Related
Unity forced me to switch from Collaborate to PlasticSCM. I used Collaborate to upload builds of my game to the cloud, so that I could expirement with new features and stuff that I could easily roll back if they didn't work. This has become very useful for me as my project increases in complexity, because often I'm adding methods or 1-2 lines or code in 5-6 different scripts with hundreds of lines, and if I don't like the way something's turning out after an hour of work for example I could've just, back when collab was a thing, upload the changes and then revert back to the previous version. Say I liked a few things I did when I added said expirmental feature, I could always upload the new version of me adding the feature, go back to the old version, copy for example a few lines of code, and go back to the new version. It was really handy.
If you look at attatched images, PlasticSCM does something similar with their "Changs ets", and I'm looking for a way to tell it to revert my project back to a previous one.
If you still don't get what I'm saying, let's say I added in a folder with 3 textures. Then, upload the changes. Next, I alter the texture. I don't like how I've altered it. The button I'm looking for in PlasticSCM would revert my project to the previous version with the unaltered texture.
Thank you all!
From snapshoot view you can right click and select "Switch workspace to this changeset"
You might need to update to the lates version of the "Version Control" plugin.
I suddenly deleted the local repo that contains all of my code. Now all of my code is deleted. I do not know where the deleted files went or any method that can help me to restore all the code.
What I have done, is right click on the repo-name and then select delete
Don't you have any save on a back-up system? Maybe on an external drive or something like that?
Have you checked your trash bin? (If you're on Linux, check ~/.local/share/Trash/files)
Just a little advice: Configure an automatic back-up on an other drive at a fixed time (once a week). That way, even if you loose the latest modifications, you don't loose the whole code.
Here is my setup -
Xcode 3.2.5
Cornerstone 2.0
SVN server 1.6
I am using cornerstone for version
control and nothing setting anything
in xcode.
Now here is the scenario -
I am working in a team (We all decided to use SVN for our new project) of 5 programmers.
Now when I add a new view controller (i.e. LoginViewController.m) on my system the .xcodeproj file gets changed immediately on my system.
Mean while another programmer also add one more view controller (SignupViewController.m). His .xcodeproj file also gets changed.
Now when I complete my code of LoginViewController I commit it. After some time the second programmer finish the SignupViewController and commits his work.
Now using the above procedure the .xcodeproj file gets corrupt and xcode won't open that project again.
Now my question is When should we commit our work when developing iPhone apps under xcode when using a third party svn client. Can someone please elaborate the process of when should we commit in cornerstone.
Should we commit the project just after when we add something in project (like files, images, music)?
It will be great if you can also provide me a tutorial on using xcode + cornerstone in real world.
One way to do this:
Whenever you want to change something to the project structure (add a class for example), you first update your working copy, make the change, and commit right away. Of course that means you'll check in an empty class, but that's no big issue in most cases.
If everyone follows that rule, you shouldn't have any problems.
Remember this:
Always update before you commit.
My iPhone application uses Core Data and a SQLite database; versions are being tracked using SVN. Adding data to the database is not reflected in the application. I make sure I delete the project out of the simulator and that the new database is added as a file to the project. I suspect the data is being cached in another location.
Please note, SVN shows no changes to the database, even when directly edited. Also, if I copy and paste the project to a new folder, delete the hidden svn folders, delete the build folders, edit the DB, delete the project out of the simulator, then compile and run, it works the first time. After that, the data again is cached in some unknown location.
Any ideas where this could be?
UPDATE:
The solution to this was to exit my SVN Client (Versions). I am still unsure of how this affected updates to the DB; I wouldn't think it would block or revert any changes. I am now able to edit and save changes.
Thanks everyone for the help.
Could be more than a couple of things going wrong here. If you have the SQLite DB added to your project by reference, and if you haven't made any code changes, then when you click "Build" you won't see your changed DB resource copied over. Basically, Xcode has long-standing problems sensing when (referenced) resources have changed. Doing a clean build is your nuclear option, as depending on your compilation time, it can take quite a while. A better option is just to delete the .app bundle out of the build directory. This doesn't take as long for Xcode to reconstruct, although if you have a lot of resources, it also can take a while. The best option (the one I use) is to leave a "dummy" file at the root level of the folder included by reference (let's say it's a blank text file), and when I update a resource, I will make a change to the dummy file, undo the change, and hit Save (inside Xcode). This triggers something in Xcode to recursively go through that included directory to see if anything's changed.
All that aside, if you are modifying the DB file, and SVN is telling you that you haven't made changes to it, you have some other problem going on. Simply put, are you certain that the DB file has been added and checked in already to SVN, so SVN knows about it? And are you certain you're editing the same file you're checking in SVN?
Could it be that the database is elsewhere? Have you tried opening the database manually to see if the right records are there?
So my desktop is my primary workstation for VS2008 that's supported on the backend by TFS. I'm hitting the road for a week and I'd like to take a project with me. I'd like to checkout the entire project, copy it to my external HD and then work off that. I know that when I try to open it on my laptop that won't be connected to the network, I'll be asked to remove the source control bindings. So do I do that, and then when I come back to the office just copy all the files on top of my checked out version? I just don't wanna mess anything up. :)
You can take your TFS solution offline on your Desktop Machine. Then you copy the working directories onto your laptop (assuming your laptop has VS and everything else set up) it will allow you to continue working.
When you get back, you copy your Laptop solution root folder over your Desktop solution root folder, and then take the solution back online. Depending on the size of your solution, this might take some time, because it will do a file-by-file comparison to see what was changed (it will do this only against the files that you changed on the road, because your solution in an 'offline mode' will still keep track of which files were changed). Then a list will appear in your pending changes. You can check each of those (as you normally would) before checking them in.
You could use SvnBridge and get it out into a svn repository, and then do whatever you want with it because svn handles working offline really well, and then check it back in when you're done.
Since you have VS2008, this should mostly be handled for you. No need to make extraneous copies.
Here's a click-by-click walkthru of the new offline feature: http://teamfoundation.blogspot.com/2007/12/offline-and-back-again-in-vs2008.html
If you want to manually manage the offline state, Ben Ryan has several instructional posts: http://blogs.msdn.com/benryan/archive/2008/07/09/using-tfs-2008-power-tools-to-modify-server-s-offline-state.aspx
Checkout the entire project if you can.
Don't remove the source bindings
Before you check-in make a copy of your local source just to be safe.