Can Xcode ask / react to file changes outside of the IDE? - xcode

Is there are means whereby if files are altered outside of Xcode, that a warning in can be shown to ask if you want to refresh the file? This feature is available in Visual Studio, for example.
As a temporary solution, were working on source files in a Dropbox folder.
Although growl notifies us that some files has changed, Xcode doesn't know about these changes.

No, Xcode won't do that, and since there's no support for plugins you're pretty much stuck with that behavior. Some suggestions:
Create a local git repository (Xcode can do this for you when you create the project, I don't know if you can do it once it is created.
Use another IDE, like AppCode (this isn't even a solution, just came to me and I decided to add it).
With a version control system you can see the little 'M' on edited files, browse changes, etc. But since you wrote that this is a temporary solution I bet you already know this.

Related

AnkhSVN see recent change

I have just installed AnkhSVN, and it works great, I just have one question. If someone else in the project commits a change to a file, is there anyway for me to see this WITHOUT updating the project? If I change something a small red box shows up on that file in Solution Explorer, is there any way to get something like that when a file on the SVN is n newer version that on my local copy? In case that doesn't work. Is there anyway to see all changes that was made since last I updated. So I can keep track on whats going on in the project?
There's a tab called 'Recent Changes' in the 'Pending Changes' window that facilitates just that. See also http://ankhsvntips.net/post/1478971385/recent-changes-auto-refresh
I would recommend using a Google Code project. This way, you can easily keep track of any update or member of the project directly on the project's Google site.
Setting up a Google Code project is easy and pretty straight-forward. Since you already have AnkhSVN on Visual Studio, the only thing would be to link the Google Code project to your local project.
You can follow this as a guide : Google Code project using Visual Studio and AnkhSVN

TFS re-add Visual Studio 2010 project

I have a project that is source controlled using TFS. I was doing some coding on my laptop when, unfortunately, my computer crashed and I ended up having to re-install Windows. I was afraid that all my code would be lost, but thankfully I was able to restore the code files.
My problem is that now I need to commit the changes to TFS. Currently the projects do not have any source bindings. I can't overwrite the current code base because there is work that has been done since my crash by other devs.
How can I add the changes I've made to TFS?
The way i've done something like this is kinda hackish, but what i usually do is get latest from TFS onto my laptop, and checkout all of the code from the project in question. Then i take the changed code and copy it over that folder, check it in. TFS should be smart enough to only really affect the actual code items that have been changed. You can see in the history the actual files that got changed to be sure.
If you know the exact files that you need to update, then that will make things much easier, because you can do the above steps, but then just check out the particular files you know of. You can do a compare between them and your new code to make sure that you don't overwrite anything your other programmers have done. Again, hackish, but i don't know of any streamlined way to do this.
You might want to make sure that you download the TFS visual studio extension, since that will give you rollback capability.

Is it possible to find a deleted xcode file?

I highlighted a line of code I was going to delete after building and running the app. After I ran the app, the code was still highlighted so I pressed delete and my entire class was deleted... I am an idiot...
The file did not go to the trash so I thought xcode might store it somewhere, does anyone know if it is possible to retrieve this file?
you can easily revert if you are using version control. if you are not using it (yet), you should -- worse things happen.
if you don't use version control and you use xcode's snapshots... you could look there. you may also be able to find it using Time Machine.
but... add "learn version control" to your #1 thing to learn this week for development.
I used the Disk Drill to restore mistakenly deleted files.
check http://www.cleverfiles.com/

I created an xcode project with the same name and I accidentally overwrote the old project

I created an xcode project with the same name and I accidentally overwrote the old project. How do I get it back? All old source is gone and it isn't in the Trash. It has all been replaced with the new project template code.
If you have backups/source control, you can re-sync your old version.
Back up/shelve what you have now, and leave it checked out/on your system. Then, try to replace just the project file(s), leaving your source code and data in-place. Re-do the changes to your project(s), and you will have undone the damage.
If you don't have source control or backups, and you didn't delete your code/data, you may still be in luck. You'll have to re-create your project files from scratch, rather than your last save point, but you can simply import your existing code.
If you don't have any of those, and you deleted the source, then you are out of luck
No matter what, your next step is to get and use source control and/or start doing automatic backups of your code. Everyone makes mistakes like this, and this is why source control/backups exist. You must use them.
From the other discussion, it sounds like your best hope might be an OS X undelete utility, one example:
http://www.prosofteng.com/products/data_rescue.php
I hope you've not been doing much with the drive though as any file, email, or anything else you've saved to disk could have been overwriting what used to be there. But, it's better than doing nothing.
I would boot off a separate drive before you downloaded that to run it.

Renaming files: Visual Studio vs Version control

The problem with renaming files is that if you want to take advantage of Visual Studio refactoring, you really need to do it from inside Visual Studio.
But most (not all*) version control system also want to be the ones doing the renaming.
One solution is to use integrated source control, but this is not always available, and in some cases is pretty clunky.
I'd personally be more comfortable using source control separately, outside of Visual Studio, but I'm not sure how to manage this question of file renames.
So, for those of you that use Visual Studio, which source control do you use? Do you use a VS integration (which one?) and otherwise, how do you resolve this renaming problem?
(* git is smart enough to work it out for itself)
I use SVN (TortiseSVN as the client) and use the Repair Move command from the commit dialog heavily. This allows me to rename the files within VS and resolve the rename when I'm ready to commit to keep version history.
As far as using the VS integration, like you, I find all VS integration clunky and do not use it.
mercurial usually prefers to do the renaming via hg rename however it can also detect renames from an outside source by using hg addremove -s 100 (or less than 100 if you want to match a rename with alterations) so clearly you can let VS do the rename and get mercurial to catchup with addremove.
We use SVN (TortoiseSVN to be exact), and i am always bothered with the renaming problem. The simplest solution i've found is to remove the files from the project, rename them via TSVN and add them back to the project. You have to manually update includes for renamed header files, but this is relatively easy using find&replace.
We use Team Foundation Server, and it works with no problems. I've also found that moving to using a fully integrated client has improved my workflow, as I don't need to flip between applications just to do trivial tasks.
We develop "Plastic SCM" and the Visual Studio Package supports move operations. But I see your point, I'm getting more and more comfortable with the idea of not having plugins/packages and then have the version control working behind the scenes and simply detecting what happened without having to be "plugged in" into the IDE. In fact we're working on it for next release...
Besides the above advice, for Visual Studio 2008 I found that after making all global changes to any file being renamed from within VS, including right clicking the file and renaming it, as well as a global search and replace for all strings, replacing the old file name with the new file name, you must, if the file is the initial startup file, right click and select it as "set as default page". Otherwise you'll may well get the "The resource cannot be found." error on runtime.

Resources