Xcode 4.2 codesense - how do you narrow down the suggested completion list?

Is there any way in Xcode to narrow down the completion list displayed by CodeSense as you type, when you have several methods that start with the same prefix?

For example: Suppose you subclass the UITableViewController and want to implement a method

-tableView:numberOfRowsInSection: 

So, you start typing:

 -tableView 

and you will get the following CodeSense completion list

Screenshot of CodeSense completion popup for -tableView

That's great, but there are plenty of suggestions available and scrolling through this list seems to win the CodeSense perspective.

How do you shorten this list further?

Selecting the second parameter in the popup list shows the following:

Screenshot of CodeSense completion popup when second option selected

For me, this means that if you type:

 -tableView:n 

you should get a completion list popup using only methods that have this prefix. In fact, all I get is "No completion".

If instead I try to start typing the method signature verbatim:

 -tableView:( 

Then I get an irrelevant completion list (it just lists the types).

The above is just an example, I seem to be very much versed in implementing interface methods.

I'm relatively new to Xcode (coming from the background of Visual Studio), but I cannot find any information about this aspect of CodeSense.

Does Codesense support this filtering, or am I just not using it correctly?

Thanks.

+4
source share
1 answer

I found that (at least for me) the best solution is the return type of the method type . It filters out a lot of things. An example for a UITableView would be:

 - (NSInteger)t - (BOOL)t 

The first gives me 3 and the other 6 sentences, which are pretty narrow.

+2
source

Source: https://habr.com/ru/post/1402096/


All Articles