Xcode 9 refactoring gives "Rename failed"

Hi


I wanted to change the name of a variable in XCode 9 9M136h. So, I selected the name, brought up the context menu and clicked on Rename. I got an error dialog saying:


Rename failed
Refactoring engine reported no changes for the initial file.


Is this a bug in xcode?


Regards
Mark

Yes, it's a bug in Xcode. In some cases, it works if you try again after a few seconds — presumably there was some indexing going on in the background that hadn't completed yet.


If it still doesn't work, try building your app. Even if the build fails due to errors, in Xcode 9 building also does indexing, so the attempt to build may fix whatever was wrong.


If that doesn't work either, you can try cleaning your project. I'm not in favor of randomly applying random workarounds like this, but for a beta Xcode it's certainly possible that it has missed updating some vital piece of derived data.

Xcode 9 release notes seems fairly chatty concerning renaming...


See the 'Refactoring' section for details..


Release Notes


Edited with new link...

Thanks. I tried all that, and in the end just did used search results and did a copy and past.

Redid the link - pls. try again.


Ken

good

For me, I only get error for a particular name. If I remove the last character, it accepts and renames successfully. Any idea why?

Xcode 9 refactoring gives "Rename failed"
 
 
Q