John Gallagher
John Gallagher

Reputation: 6278

Xcode refactoring error - "The Selection Does Not Contain Identifiable Content"

  1. Select a method

    Selection http://synapticmishap.co.uk/aSO/SelectionGrab.jpg

  2. Edit > Refactor...

  3. Select "Move Up"

  4. I get the following error a lot.

Refactoring Error http://synapticmishap.co.uk/aSO/RefactoringError.jpg

Any ideas on how I can get Xcode to, well, do its job?

Solution Summary

Option 2 that Peter suggests below did the trick. I can't believe that

a) I didn't try this Smacks head

and

b)

Xcode couldn't find a sane way of saying "Don't select the whole method!"

Upvotes: 1

Views: 491

Answers (2)

Alex
Alex

Reputation: 9429

I tried refactoring a class (implementation) after I renamed the containing file manually and got the same error. Once I renamed the file back to its original name I was able to refactor.

Upvotes: 0

Peter Hosey
Peter Hosey

Reputation: 96373

Two possibilities:

  1. Maybe that blank line at the start is screwing it up? Try starting the selection at the -/+.
  2. Try right-clicking the first segment of the selector and Refactoring that.

Upvotes: 1

Related Questions