Jeff.Lu Jeff.Lu - 3 months ago 7
Objective-C Question

How to copy the objective-c method name more effecively in XCode?

I have the method:

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
return items.count;
}


What I do now is to copy the whole first line and then remove the words about the formal parameters. Is there a better way to copy the method name so that I can get
tableView:numberOfRowsInSection:
quickly?

Answer

This seems not very nice, but you can right-click on method name, then Refactor -> Rename and Cmd+C to copy method name.

For even better access you can set the shortcut for this in Xcode -> Preferences -> Key Bindings -> Rename. That will require one click on method name and two shortcuts for getting signature

Comments