5

重命名变量/类对我来说似乎被打破了。XCode 4.5.2 弹出一个菜单,询问我要将变量重命名为什么,我输入名称并点击预览,然后出现另一个屏幕,显示消息“选择不是可以改名了。”

我试过删除派生数据(通过命令行,也通过管理器),它没有修复它。有人找到解决方案了吗?有几个人在旧版本的 XCode 上遇到过这个问题,但他们说它已在新版本上修复(但我使用的是最新版本)。

4

3 回答 3

3

I've just spent about an hour trying to get refactoring working again on Xcode 5.0.1 after it spontaneously stopped working for no apparent reason.

I'm not sure what step actually fixed it because it seemed Xcode was keeping certain processes running even when I was quitting it, so it actually started working after a reboot of the machine, but these are the steps I took:

  • Quit Xcode
  • Deleted ~/Library/Developer/Xcode/DerivedData
  • Deleted .xcodeproj/project.xcworkspace/xcuserdata
  • Deleted .xcodeproj/xcuserdata/.xcuserdatad
  • Reboot
  • Restart Xcode
  • Product -> Clean Build Folder

After that, refactoring seemed to spring back into life. Deleting the xcuserdata did mean that Xcode lost some of my layout settings, etc but having a working refactor tool was more useful!

于 2013-11-06T16:01:37.917 回答
0

在 *.m 文件中选择类名时出现此错误。就我而言,解决方案是在 *.h 文件中执行此操作。

于 2013-01-02T17:10:03.020 回答
0

不知道您的问题,但是当我尝试预览时,可以看到分屏视图或更类似于 xcode 的辅助编辑器视图(可以同时查看 .h 和 .m 文件)以及要重命名的变量实例旧名称和新名称。在你的情况下它可能会被窃听。是在所有项目中都相同还是只是其中几个?

于 2012-12-06T11:01:39.620 回答