objective-c syntax

App Development & Programming

I am learning basic syntax of Objective-C and need to write an underscore. Does anyone know which keys to press to make the underscore? I am using a MacBook air.



Submitted by mehgcap on Friday, February 19, 2016

Member of the AppleVis Editorial Team

The underscore is shift with dash (the key to the right of the zero, at least on U.S. English keyboards). In case you aren't aware, and still on U.S. keyboards, the brackets are to the right of the P key. Adding shift to them will turn them into braces.

Good luck with Objective-C. I'm a bit surprised you're not starting with Swift, but ObjC is a good one to be familiar with.

Submitted by molly on Friday, February 19, 2016

In reply to by mehgcap

Thank you.
I am using English U.S. keyboard. When I press shift dash VoiceOver says underline, but that probably means the same thing as underscore. So far Objective-C is the only programming language I have used and I like it very much.

Submitted by mehgcap on Saturday, February 20, 2016

Member of the AppleVis Editorial Team

Yes, underline and underscore are the same. Sorry, I'm so used to hearing them (and "line", in NVDA) used interchangeably that I didn't even think to mention it. You should check out Swift; it's even easier to read and use, and offers some really nice advantages.