Friday, July 30, 2010

Clang for iPhone – syntax error before ‘AT_NAME’ token

July 6th, 2009 by s

So I finally got tired of struggling with Instruments trying to find memory leaks. I first read about Clang a while ago , but just filed it away to check out later.

But Instruments proved too frustrating, so I downloaded Clang from here. It was a little tricky to install, but after a few hurdles, I found 20 memory leaks in my app. If you’re developing iPhone apps, you really need to check out Clang if you haven’t already.

Two things tripped me up in the installation process.

1. Could not find clang-cc line

The solution for this was at cramfighter.com. Basically I need to change some projects settings.

2. syntax error before ‘AT_NAME’ token

This was tricker to figure out because there errors weren’t in my files and looks like the problem started with the 3.0 SDK. I ended up going with this solution as a temporary workaround. This involved commenting out the UILocalizedIndexedCollation.h import in UIKit.h.

As is often the case, after I got things up and running, I found a great page with an intro to Clang at fruitstandsoftware.com.

Posted in iphone | No Comments »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.