Reputation: 41
To Xcode xPerts: I have been doing Java in Eclipse for about 9 years now and I have really gotten used to the power of the refactoring tools. There are a few operations I do all the time. I am looking for equivalents in Xcode since it has better support for objective-c than eclipse. (I'm not at my Mac as I write this. So some of this is from memory. I am still very new to Xcode.)
It seems that the Xcode equivalent for variables is "edit all in scope". Does this work for files/classes/methods too?
select an expression it creates a local var initialized to that expression. It even creates a usable name for the variable.
select some code and it will create a method with that code and appropriate parameters/return value.
opposite of extract, inlines all or just the selected occurrence of the selected var or method.
occurrence of selected text. In eclipse I can select some text and hit ctrl-k to go to the next occurrence of that in the file. likewise shift-ctrl-k finds backwards. IIRC the Xcode "find next" ignores the selection and only uses what is in the find box.
This would be very useful with ocjective-c's named parameter messaging syntax. This is great for adding parameters to a method.
for moving methods up or down the class hierarchy.
for moving elements around to other classes etc.
Those are the ones that I use all of the time. I have estimated that these tools cut my coding time in half. Are any of these supported in Xcode?
Thanks in advance for any advice.
Upvotes: 4
Views: 950
Reputation: 20799
You can read the Xcode user documentation on Refactoring on any machine. It will answer most of these questions.
Upvotes: 1
Reputation: 21
Yep, right-click on a symbol then select Refactor.
There doesn't appear to be a "change method signature". I've used that feature for years in other IDEs. I guess the only thing to do in xcode is change the signature and hope that you get a compile error for everything that needs changing...not a great refactoring tool.
Xcode look slick in many ways, but there are some annoying omissions (anyone want to view the content of collections in the debugger?)
Upvotes: 0
Reputation: 190996
For #1, if you right click a symbol name, you should have the Refactor
menu option that permits you to rename the ivar, property, type name (including file names), etc.
Upvotes: 0