XCode Editor, Debugger, Build results all in one IDE - xcode

I remember seeing it from the release notes of an earlier XCode version saying that it allows the three all in one IDE since then, instead of having to switch back and forth between the different windows when working on build, debug and editing. But with the latest XCode install, I still have to do that in separate windows. Is there a special setting to merge them all together under one IDE/window?

It's in XCode preferences, called "All in one" layout. Check this:
http://img.skitch.com/20101121-xsxhc34ywurcf14yuhm6hna5qi.png
Note that in order for that to be changed - all projects must be closed.

Related

Xcode Source Editor option not displayed in Extensions

Is there a way to activate Xcode Source Editor option in System Preferences > Extensions? For some reason, it's not showing on my Mac (the last option).
If the Xcode Source Editor is missing from the left pane (see image above), try one of these solutions before resorting to a reinstallation:
In the Applications folder, rename Xcode and then change the name back to Xcode, or move Xcode.app out of the Applications folder, then back in, as described by this Stack Overflow answer.
Move the Xcode app to the Trash and re-install it from the AppStore.
I install the Xcode manually that's why not found on Extensions.
To fix quickly:
Quit Xcode
Rename Xcode in the applications folder temporarily with any name.
Launch renamed Xcode
Quit Xcode
Name it back to the old value ("Xcode")
Go back to Extention you will find the Xcode
The entry is shown if the system detects that both Xcode and at least one Xcode extension is installed. Yet the code to detect Xcode has a few issues.
If you install Xcode first and don't have an extension, the entry is not shown. If you then install an extension, the system re-checks if Xcode is still installed and if yes, it should add the entry. However, the check code will fail in some situations. E.g. if you renamed Xcode.app to something like Xcode_13.4.app (as you need to manage different versions of Xcode), the detection code may not find it. It also may not find it if you moved Xcode to a different location outside of /Applications. And even if not renamed and still in the default location, the detection code sometimes fails and the exact reason why that happens is unknown (it may have issues with certain ownership, certain file permissions, case-sensitive file systems, etc.)
In all these situations, renaming Xcode causes it to be re-detected by the system and then the system sees that Xcode and at least an extension is installed and the entry appears immediately. No need to reboot or start the renamed Xcode; you rename it, you rename it back, and the entry is there and will stay there (even after deleting all extensions, it stayed on my system).
If you first installed any app with an extension and then Xcode, the problem does never appear as in that case you immediately trigger the rename-fix above, because the moment you install Xcode, the system will always detect it correctly (regardless how the app is named or where it is located or any other issue the scan code might have) and detecting Xcode and knowing there is an extension, the menu entry appears at once. The code that detects Xcode extensions seems to always work correctly.
This is probably one of the issues where the Xcode detection code has not been tested very well by the Apple but since it seems to work for the vast majority of users, Apple sees no reason to further investigate why it would sometimes fail.
It will get activated by default if any plugin are added in Xcode.
You have to download XcodeClangFormat plugin from GitHub and follow the installation steps. Then Xcode Source Editor will be visible automatically.
Please refer this link

Xcode 5.1: any way to suppress Revert/"Keep Xcode Version" dialog

As of Xcode 5.1, when I change the project out from under Xcode (in my case, most commonly, by checking out another git commit), it throws up an annoying dialog, even when not active:
Worse, I'm using Spaces (or Mission Control... whatever the hell it's called now), and the dialog gets separated from Xcode and lost, and yet it's modal and keeps Xcode from accepting input. Sometimes I find it, or it pops up in the Xcode space. Sometimes this requires force-quit on Xcode to get control back.
Short of quitting Xcode every time I change commits, is there any way to end this madness?
I chose revert to disk because the "disk" is the new code which I just pulled down from my repo. "keep xcode" is the code that was sitting there before I chose to change branches or pull rebase.
Just close the project that you're going to make the change on before you make the change. I always close projects before I check out a different commit or branch, and never have this issue. It's safer to do it that way, too.
I don't think there's any way to just suppress it altogether, and if you did, you would have to choose a default behavior for it, which wouldn't necessarily always bet he same. So it would be a bad idea for Apple to give you an option of not showing it.

Xcode 5 equivalent of NS_BLOCK_ASSERTIONS in Build Settings

Until Xcode 5, Release builds could be prevented from including NSAssert statements and their variants, using the default Build Setting:
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
This setting can be found in project.pbxproj and is set in Xcode here:
(Note that this grab was taken from an Xcode 4 project converted to Xcode 5.)
Each target would inherit this setting in the Release build only. Obviously this was a good thing. Rather than crash immediately, the app would possibly struggle on regardless. Whereas for Debug builds, you want to know immediately when an NSAssert fails.
However, I am struggling to find the equivalent in Xcode 5.
Creating a new project using the default templates shows no equivalent setting:
My question is, what is the equivalent setting in Xcode 5, or does NS_BLOCK_ASSERTIONS have to be added manually to Other C Flags for the Release build?
It's got it's own setting field now! Enable Foundation Assertions. Set your debug as yes and your release as no, as shown in screen grab below.
Note: You need to click All in the top left in your build settings tab to see it, you can see in my screen grab the blue ALL in the top left.

XCode Local Changes Indicator like other IDEs

I'm new to XCode and Objective-C programming. I have used WebStorm, IntelliJ, Netbeans, and Eclipse. They all support something like this:
Notice the colors on the left that indicate what's changed locally. Clicking on those will show me what it was before and allow me to reset the local copy to what it was before. Very useful and I do it all the time.
Obviously, with iOS programming, I want to use XCode, but I really want to have those indicators. All I see with XCode is this:
Notice that there's no indicator at all...
Note: I am not talking about being able to open a git diff tool, even if it's built into XCode. I am looking for the simplicity that all the other IDEs give me...
The closest thing in Xcode is the version editor. Choose View > Version Editor > Show Version Editor to show the version editor. The version editor shows your local copy and the last committed version of the file side by side and highlights the changes between the two versions.

Xcode 4.2 Product -> Run Greyed Out

My "Run" button under "Product" is greyed out and after trying a few things from various forums, can't figure out what's gone wrong.
I've tried removing the project.xcworkspace and xcuserdata files and letting xcode generate new ones, but no...
My co-worker uses AppCode from IntelliJ and when he pulls the code, it runs just fine. But if he opens the same files in his Xcode, his "Run" is also greyed out.
"Edit" your current "Scheme":
Make sure you have "Run" checked for that build target:
The scheme need to be fixed (I don't know why xcode changed it)
Here are the required steps:
, ,
Make sure you have the correct target selected.
(Upper-left in Xcode window, near the triangular Run button.)
My co-worker who uses AppCode had edited the configuration file, moved some frameworks around, etc... We noticed that there was a difference between XCode and AppCode in using relative vs. absolute paths in the project.pbxproj file.
Ultimately I just reverted the code to before his changes, so at this stage, I'm not entirely sure which difference in the config file actually caused Xcode to not be able to Run the project.
**EDIT
From the .git logs, it looks like AppCode was adding relative directories with 7 sets of "/../" and before there were only ever instances of 5 "/../" to get back to the root directory.
Rather frustrating that Xcode had no way of dealing with this from inside the IDE.

Resources