Xcode autocomplete: is it possible to suggest "NSString" when I typed "NSS"?

Xcode offers me β€œNSSet” when I typed β€œNSS”. This is not very good for me. I use NSString quite often.
Can I suggest "NSString" when I typed "NSS"?

+4
source share
3 answers

Enter NSString in the editor, select it and drag it with the mouse into the code snippet library (^ 2 if you don’t open it), and then set the completion shortcut for not using Xcode, for example, "foo".

custom code snippet

Now, every time you want to use NSString , just type foo and Xcode will suggest autocompletion with NSString . It takes some time to get used to typing something else just like using the Shrikar macro, but it does not add anything new to the code itself.

BTW related comic: http://i.imgur.com/YRRHc.png

+6
source

I do not know a direct way to influence the first sentence shown.

However, you can always choose from many other choices, or even easier, just enter "NSSt".

+1
source

Yes, I know this is really annoying. I use the NSString path more often than the NSSet , and apparently xCode does not accept usage frequency and does not have auto-hint ranking.

I used one way around this. Its a kind of hack, but as programmers without hacks, where are we;)

I used to create macros. So you can create one like this:

#define xNSString NSString

This way, xCode automatically indicates what you need.

+1
source

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


All Articles