Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 744
Jeff.Lu Avatar asked Nov 23 '15 02:11

Jeff.Lu


1 Answers

In Xcode 7.3 and above you can simply do the following:

Given a class ReportsListViewController and the -tableView:numberOfRowsInSection: method:

To "Copy Qualified Symbol Name"

Place your cursor anywhere on a method name. Press Shift-Cmd-Ctrl-Option-c (All the modifiers) - This will place the following in your clipboard:

-[ReportsListViewController tableView:numberOfRowsInSection:]

To "Copy Symbol Name"

Place your cursor anywhere on a method name. Press Shift-Cmd-Ctrl-c - This will place the following in your clipboard:

-tableView:numberOfRowsInSection:
like image 62
DeepFriedTwinkie Avatar answered Oct 19 '22 23:10

DeepFriedTwinkie