Xcode Real-time Syntax Checking? - objective-c

I'm new to Xcode and Objective C, but I'm digging my way through the IDE and noticing that it doesn't appear to do live syntax checking. If I make a typo, I have to build the project before Xcode will even mention that there's a problem. Worse still - since it's returning compiler errors, it's usually not even the (in)correct line that's highlighted!
Is there a setting that I'm missing, or is that just what I'm stuck with compiling to check for syntax errors?

Assuming you're using Xcode 4.*, go to Preferences -> General, select "Enable Live Issues".

Select Target from TARGETS Navigator, select Build Settings, LLMV CLL 4.2 - Language > change Precompile Prefix Header setting to "NO", re-open Project (Workspace). It's worked for me.

Make sure you're on the current release of Xcode 4. Despite the 4-ish-ness of its version number, it was a complete rewrite from the previous release, and the early editions of it were sketchy, especially in "code sense" features like syntax highlighting and live error checking.
I've been much happier with it in its last few releases.

Related

Why is Xcode's debugger jumping around this way with Swift?

I debugged the following code with F6 in Xcode 6, and the sequence of execution is very interesting.
Here is the code - 7 lines, a breakpoint is set on line 1:
let request = AWSDynamoDBPutItemInput()
request.tableName = "blah"
let card = AWSDynamoDBAttributeValue()
card.S = "1234"
let email = AWSDynamoDBAttributeValue()
email.S = "notset"
request.item = ["card_number" : card, "email" : email]
When I F6'd through the code, it showed the following sequence (the numbers are line numbers):
1,2,4,2,3,4,6,4,5,6,7,6,7
Why is this? Is this something with Xcode or the language? Those classes are defined in Amazon's AWS SDK, not sure whether that matters, they are accessed through swift-objective-c bridging, could this be related to the bridging.
By the way, the net result of the execution is correct.
I think what you're observing is the effect of the compiler optimizations. It rewrites your code at compile time. For this reason it's normal to disable optimization (-Onone) on debug builds, but enable it (-Ofast or -Os) on release builds.
Finally I got a reply to my bug report from Apple, and sounds like it was a bug and got fixed in a beta version of XCode. If you are seeking for a fix, please try the beta:
We believe this issue has been addressed in the latest Xcode 6.3 beta, including iOS 8.3 SDK with Swift 1.2.
Please test with this release. If you still have issues, please include any relevant logs or information that could help us investigate.
This is a pre-release version of the complete Xcode developer toolset for Mac, iPhone, iPad, and Apple Watch. This release requires OS X Yosemite.
Xcode 6.3 - Build 6D520o
https://developer.apple.com/xcode/downloads/
You should open your project and targets configuration page, under the build settings tab, locating the "Apple LLVM 6.1- code generation" tag, change the optimization level for debug to be "None [-O0]", clean your project and you are done!

XCode 5: Automatic ARC conversion unavailable

I decided to bite the bullet and convert my large years-old project to ARC.
BUT,
All of the menu items in XCode-5->Edit->Refactor which contain the term "Refactor" are dimmed and unavailable. No fiddling has been able to enable them.
If I create a new empty project, they are available, but when I open my old, large project, they are not. The project has been "updated" by XCode to be "XCode 3.2 Compatible", the most recent compatibility level it offers.
Because XCode doesn't know how to import an existing project, or even know how to accept a drag of a Group from one project to another, transporting this large, complicated project into a new project file would be a time-consuming, error-fraught undertaking that I am hoping to avoid.
Anybody seen this problem, and resolved it without starting a new project and laboriously copying files over?
So the answer (Thank you, Greg Parker!) was that the platform was still set to x86+x86_64, which disables the ARC conversion tool. You may also need to quit XCode and re-open the target to get the Convert To ARC menu item enabled.

Project refactored to suppport ARC now while building the project getting error "language not recogonized ml2"

My project was perfectly building before it is refactored to support arc. Now when the refactoring is applied, it is not building and an error message is shown that language not recogonized. Any work around for this?
The linker command line shows an option "-xml2", which is wrong. You have to find and remove that option from the "Linking" options in the build settings.

xcode - Need suggestion comment in source file

I started adding comments to the code while i am developing the app (objective-c). The bad thing which i am noticing is the breakpoints and warning or error reporting, it is actually showing a wrong line number or pointing to incorrect line number, is there a solution for this problem. Thanks.
This is usually a problem with your Derived Data, the build products that are cached after each build so they don't have to be rebuilt if they aren't changed. The problem is, sometimes Xcode doesn't recognize a change, and what you see in the editor no longer matches the build product. Clean your product with Shift Command K to do a full rebuild. This should fix the inconsistencies you're seeing.

MonoDevelop - Highlighting type names

Is there a way to configure MonoDevelop to highlight type-names like VS does?
I am using MonoDevelop 2.8.8.4 on Fedora-17.
It looks like MonoDevelop semantic highlighting is back on 3.0
I've got MD working on Ubuntu- though I have it running by pulling source from github and (after doing all the necessary build steps) calling make run- in case you would like to give it a go; I can highly recommend moving to 3.0.. (if possible), it's got some other refactoring capabilities that make it worth it!
In order to get semantic highlighting, you'll need to upgrade to MonoDevelop 3.0.x