Xcode is stuck when trying to refactor a class
Xcode gets stuck if I try to rename 开发者_运维问答a class via refactoring.
It shows "Applying Changes" window and says "Please wait while changes are made." But changes are never made. It's stuck!
How can I solve this problem?
3 years later using Xcode 5, this is still a bug. Only thing to do is file a radar.
Only appears to happen some of the time however, since others have gotten it to rename a class in this SO question - Rename a class in Xcode: Refactor... is grayed out (disabled). Why?
Hold alt (option), and right click the Xcode icon, Force Quit. Open Xcode and do it again. Pain but solution.
You'll need to force XCode to quit via the Activity Monitor, and relaunch it.
Open Activity Monitor:
- CMD+Space (opens Spotlight search bar)
- Type "Activity Monitor"... it'll likely show up at the top of the list before you finish typing the whole thing
- Press enter if "Activity Monitor" app is highlighted in the spotlight list, or click on the icon.
Force Quit XCode:
- Select "XCode" from the list to highlight it
- Click the big STOP icon to force quit.
Open XCode Again..
it is not well solution but you can try this. first open terminal, then:
ps aux | grep Xcode
then get the PID from processes list. you will see something like that:
<username> 3055 0.0 5.1 4392432 429552 ?? S 11:46AM 1:48.16 /Applications/Xcode.app/Contents/MacOS/Xcode
here, 3055 means Xcode process name. There might be some child processes under Xcode, but you should choose one of plain Xcode process.
then call,
kill -9 PID
for my sample,
kill -9 3055
quick and dirty solution.
In a terminal, faster:
killall Xcode
精彩评论