Xcode keyboard shortcuts for go to class from xib and from xib to class?
Is there a keyboard shortcut for jumping from the current xib file to i开发者_C百科t's class (ViewController)? And back from it's class to it's xib file again?
I use ctrl-command-up/down all the time to to jump between header and source, be great to have one for the view xib also.
There are a couple of quick ways to get to the XIB associated with a class.
CTRL-5-↓-enter
This will open the jump bar to the current file. Assuming your XIB is named the same as your class -- which is usually good practice to do -- the matching XIB will be the next item in the list if you are in your implementation file, or two down if you are in your header file.
Alternately, you can open the XIB or StoryBoard associated with the file with one mouse-click if you have an IBOutlet
.
See the outlet indicator next to the IBOutlet
?
Click on it!
For additional Xcode shorcuts, a great resource is this PDF maintained in github: http://cloud.github.com/downloads/Machx/Xcode-Keyboard-Shortcuts/Xcode_Shortcuts.pdf
I don't know if there's a keyboard shortcut for jumping from xib to corresponding class header file. But you can do that easily with a few mouse clicks:
- Select a UI object in storyboard
- Select "Identity inspector" in Utility Panel (3rd tab from left)
- Click right-pointed arrow in the class name text field on top, which will take you to the header file
- You can always go back and forth with two-finger swipe in Editor panel
Most shortcuts can be seen here: http://cocoasamurai.blogspot.com/2011/03/xcode-4-keyboard-shortcuts-now.html
And although that would be an awesome one, don't think it exists.
精彩评论