How to view IOS documentation using Xcode? - xcode

Is there a shortcut i can use to display or search Obj-C API?
Say, i'd like to learn more about what IBAction does, i wonder if i can mouse over it and view documentation. Is there a way this can be enabled? A side bar possibly?
Please advise

Option-click a class name and a window will pop up with a description. Click the book icon and the help window will open to that class. Command click to view the h file.

Not that I know off, but you may see the source code at any time, and that has plenty of documentation on the comments.

Command + click on it, then click Show Quick Help
Also there's a keyboard shortcut for opening general documentation list.
Command + Shift +0 (Zero)

In Xcode 4, the Organizer window has a documentation section which can be accessed from the Right sidebar (Quick Help, which is part of the button group to enable the bottom bar (GDB by default) as well as the left sidebar (Class tree/etc) ) of the main Xcode window whenever you click on basically anything in the code (if its a custom method/variable it only tells you where it is defined). However, if it is something like IBAction it will pop up a brief definition as well as a link to open the previously mentioned organizer to the appropriate documentation page.

Within the Quick Help information, click Open in Developer Documentation to access Xcode documentation, which includes more thorough explanations and references to related functions.
You can also access Developer Documentation window from the Xcode Help menu.
Another option is by using the keyboard shortcut Command+Shift+0.

Related

How do I change 'Selects Code Structure' from cmd + click to a keybinding?

I can't find any shortcut in the key-bindings list that will display this pop-up code actions menu. Is this strictly a click action only? Are there any potential workarounds for this?
I'm coming from vscode and I really loved being able to hit a keybinding and bring up all my code actions.
Thank you in advance!
I am not pretty sure what is your intend but i would rather use to this one for your case,
command click on code as jump to definition :)
what you do in Vscode Ctrl+Click is equal to cmd+click in Xcode

manual option is not showing in Xcode 11 assistant editor and how to add IBOutlet?

I recently updated to Xcode 11 and some of its user interface changed. in older version of Xcode there was options of accessing files in assistant editor using automatic or manual. but in this version of Xcode I can't see any manual option in assistant editor. so I am not able to add IBOutlet and IBAction methods to particular storyboard.
so can anyone tell me how to add these actions and outlets, that would be great help. thanks
By pressing the above button, Xcode will split the view and allow you to select a custom file using the file tree at the top.
You are correct.
The Manual option is no longer visible. You can still achieve the same result by doing a quick open using Cmd+Shift+O then type the name of any file you want to open. Press the Alt key and the file will open in the Assistant Editor Window.
As others have noted the new add editor button allows you to add new editors and open files into them. You could file a bug report but you may want to consider that you're likely to get a "works as designed" type of reply.
You can always change or add new keyboard shortcuts to get the behavior you want by viewing the preferences key bindings area and search for the command you want to shortcut.
Note
You can still ctrl+drag from storyboard to the class by the Adjust
Editor button in the upper right of the storyboard. Then just select
Assistant Editor on the list. After which you can make IBOutlets/IBActions.
open your storyboard, hold option key and select the file you want
In the documentation outline of storyboard, try to choose the "correct" item, which you want to set up outlet connections. Say you want to set up an outlet connection for cell of table/collection view.
View Controller > Collection View > Cell > Content View > Image View.
Try to select Cell, "Content View" or "Image View", then check the jump bar of assistant editor, you're probably able to switch to the .swift file you want.
Reference

RStudio: can I pop out the source pane?

I have a dual monitor and I wish I can pop out the "source pane"(where I edit my code), so that I can edit the code in one monitor and track everything else in another.
Does anyone know if this is possible?
Thank you very much for your help.
This feature was just added to RStudio this week. You can try it in our daily builds (0.99.636 or newer):
https://dailies.rstudio.com/
To pop out your file to a new window, either:
Drag the tab outside the RStudio window to where you want your new code window to appear, or
Click the "Show in new window" button on the editor toolbar (it's next to forward/back)
If you try it, let us know what you think on the support forum.
I'm using the latest Studio and encountered similar needs. I found that ctrl+shift+number will suit my needs most of the time since it zooms to the pane that I desire and can also back to the full four window layout.
An additional trick is customize the hotkey to alt+number [1,2,3,4,5] so the pane zooms more handy with one click by your left hand on the keyboard.
Hope it helps.

Xcode 6 - Main.storyboard only showing up as source code, Interface Builder missing

Somehow my Xcode settings got messed up as it would only show my Main.storyboard file as XML code. I've been told this can be fixed by selecting the Interface Builder from the "Open As" menu, but there is nothing under the menu (the only "selection" is a greyed-out "<None>"). I've cleared my Xcode caches, but this does not help. Other than that, my project still compiles properly.
How can this be resolved?
As so many people have pointed out, right-click on the file and hover over Open As and select Default - Interface Builder.
However, if this is not an option for you because Open As shows <None>, make sure you are in the standard editor and not the version editor. Go up to View in Xcode menu --> view --> hover over Standard Editor and select Show Standard Editor. Now repeat the steps others have suggested and you should get the results you're looking for.
Hide Code Review helped here (Xcode 12.2).
You might be in code review mode and Xcode thinks you want to compare the XMLs
change to Standard Editor by clicking 'Command + Enter' key . Then Main.storyboard may show as Interface Builder.
I had the same issue, where "Open As" wasn't an option on the main storyboard, and xibs were also showing as XML.
The solution that worked for me was to right click on an xib which did have the "Open as --> Interface Builder" option. Then, I went back to storyboard, and the main storyboard showed up properly.
Tap on the Arrows icon that are left and right, see image below:
If you go over to the project outline and control click on the storyboard file and hold down the cursor, you will see the option to open as, this will let you open the storyboard as a certain type. Click on that and choose open as story board. Good luck!
EDIT#1
Sorry, I think I misread your post. I thought you were doing those steps from the menu bar. Not the outline. I am assuming you have restarted Xcode and your computer.
I had this issue with Xcode 8, no luck with Open As > menu... and the solution was as follow:
Make sure the Type is Default - Interface Builder in the Identity and Type right panel (see screenshot). In my case it was "Swift source code" selected :
Now, in the left pane, right-click on your storyboard, and magically then the option Open As > Interface Builder - Storyboard appeared !
I had "Main.storyboard.xml" in Xcode 9 folder but can not see "Default - Interface Builder" in the list of extensions proposed in "Identity and type".
I simply deleted the .xml extension in the name of "Identity and type" and then I can see again "Default - Interface Builder" in Open as.
This is just a quick fix/ long shot, and depending on the specifics of your situation it might not be helpful at all, but you can import and open storyboard files in other projects.
So, try importing your storyboard file in a new project and see if it displayed correctly there.
Has helped me in the past with misbehaving nib files.
Took some doing but I found how to fix this every time... When you click on the storyboard and it is showing as source, click on the icon that shows the utilities view on the righthand side.. Look for the identity type.. Type should be Default - Interface Builder.. Mine got switch to C Source Code.. Not sure how.. but...
I was stuck at (Hide Code Review helped here . You might be in code review mode and Xcode thinks you want to compare the XMLs)
left and right arrow icons is code review Mode

Does Xcode have code navigation feature?

Does Xcode have a code navigation feature? Like unix's cscope type of tool which I can enter the name of a class and it will open the file for me? Or find out the caller of a particular method of a class? Or show the type hierarchy of a class?
command-shift-D (Xcode 4: command-shift-O) opens a Quick Open window where you can type a partial class name and hit enter to open the file. As far as more complex versions such as what Eclipse offers (method names, symbol names, etc), I don't believe anything like that is built into XCode.
In addition to the Quick Open window, there is the class browser. The class browser allows you to view the class hierarchy. The Class Browser can be found under the Project menu.
The "Jump To Definition" item is accessible through CMD + double click, which takes you directly to the relevant code
Also, you can "Jump To Documentation" by (Option or ALT) + double clicking on a class/method/property
Update:
Option + double click no longer takes you directly to documentation in Snow Leopard. Now it opens up a little documentation "bubble", with the option to jump to the documentation browser if needed.
If you Ctrl click a class name, method name or function name you will get a long meny where you can find the Jump to Definition item.
From XCode 4.4 upwards, you can find callers and callees by opening the "show related items" pop-up for a selected (highlighted) method:
Mark method in code (using your cursor or double click name)
Press Ctrl+1
Select "Callers" from the pop-up menu
You can also go View->Standard Editor->show related items or press the tiny button just left of the arrow buttons in the line just above the editor window (where it shows your currently selected file and method).
Also: select an identifier, right-click on it, and choose Find in Project > As Symbol (or Find in Project and choose Symbol as the search type) shows all symbolic uses, that is, declarations, definitions, and call sites.
There should opens up something like an element preview window or bubble when the user point to a method or item. The "Jump to Definition" change the users focus and take 2 steps to go to the target.
The relation window and context window in Source Insight is a good example,but I can't find them in Xcode and other dev tools for the mac.
By the way,the context window should have multiple layers to trace a deep referenced method like the split window in Xcode, not only one layer in the source insight.

Resources