17

Is Xcode 5 able to change method's signature? As far as I can tell no, but I'd like to be shown wrong.

If I either try to add (or remove) a method's parameter, I am welcomed by the Needs 1 fewer (more) colon to match original error.

Must I really do a manual refactor in this case?

Blaz
  • 3,548
  • 5
  • 26
  • 40

2 Answers2

0

Mark the first method name with the colon ("startRequest:") and then click on Refactor-> Rename

Example:

- (void)startRequest:(NSString *)url with:(NSDictionary *)post

http://developer.apple.com/library/ios/#recipes/xcode_help-source_editor/RefactorRenaming/RefactorRenaming.html

Kaptain
  • 1,358
  • 12
  • 20
  • 4
    At first, I was taken aback by your suggestion that it matters which _part_ of the method you right-click on (i.e. `startRequest:` rather than `with:`), but now I see that you probably misread my question: **can you add/remove a _parameter_?** – Blaz Mar 19 '13 at 19:59
  • 4
    No I can't add/remove parameters – Kaptain Mar 22 '13 at 13:23
0

As far I have also been unable to find a way to do this. In general Xcode is not very good for refactoring.

Therefore, I want to suggest you to look for other IDEs to use for refactoring. As a matter of fact, this is almost a common approach. I am unable to point you which IDE would be ideal for this though, but there are a few options.

Stan
  • 2,151
  • 1
  • 25
  • 33