开发者

Xcode 4: cannot refactor projects located in /Developer

I've recently upgrade to Xcode 4 and was genuinely hoping that this new ver开发者_JS百科sion might put Xcode on a more equal footing with other IDEs like Eclipse and IntelliJ, but it's looking increasingly like Apple is still way behind.

I was especially looking forwarding to new refactoring options. But now I can't use any at all! Whenever I try to refactor I get a lovely dialog saying

Refactoring is not supported for projects located in /Developer.

I keep all my dev projects in /Developer. The dialog suggests that I copy the project to another location to enable refactoring, which I am extremely loathe to do because of all the pain of broken file references that will follow (yet another one of Xcode's major detractions).

Is there any way around this? I need to be able to refactor. I don't want to copy the project out of /Developer. What can I do?

Thanks.


Don't keep your projects in /Developer. That's owned by Xcode, and if you're not careful you might end up deleting everything when you install an update. Make your own directory for your code, and it will work.

You mentioned that you don't want to move your projects because you fear broken file references. In most cases, that shouldn't be a problem, as file references are by default relative. Occasionally you'll find an absolute path in there, but it's easy to fix the broken reference—the file will be highlighted in red, so just select the file, open the File Inspector pane, and click the little Finder Window button next to the filename. You'll be able to select the new location. This even works for multiple missing files; just select the whole group of them, then click the Finder Window button to select the folder containing the missing files.

Xcode 4: cannot refactor projects located in /Developer

<-- This is the Finder Window button I'm talking about.

Once you do that, the missing file references will be resolved. I'd argue that moving your projects would be good for this purpose alone—it will help you clean up all those absolute paths that you intended to be relative.

If you don't want to play by those rules, then you'll just have to live without refactoring. Sorry; that's just the way it is. The Developer folder is intended to hold the developer tools, not your own code. There are uninstallation scripts within the /Developer folder that will delete the entire folder. It's really not a good place for your own code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜