Press the Ctrl and F4 keys on the keyboard simultaneously to close the current open program or window. You can also press the Alt and spacebar keys simultaneously, then arrow down to the Close or Exit option in the menu and press Enter .
I find the shortcuts to open & close various areas of the screen must useful.
Cmd + Shift + o opens the "Open quickly" dialog, where you can quickly find and open files that contain the text you enter.
Updated for newer versions:
Control + Command + ↑
Switches between corresponding .h / .m files or as Apple's own documentation, it means Jump to Counterpart
command + shift + j
Reveals the current file in the project navigator. Very useful if you use command + control + J to jump to a definition as Xcode won't automatically reveal the containing file in the navigator.
command /
Comment out the current line, or multiple lines if they're highlighted.
Comes in handy for quick commenting and uncommenting while experimenting with code.
Re-indent. It's in Edit > Format > Re-Indent
and there's no shortcut by default (I use Command + Shift + L). It's a godsend.
command F Search in the File
option command F Search & Replace in the File
shift command F Search in the whole project
shift option command F Search & Replace in the whole project
Notice the pattern for easy memorizing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With