Monday, October 04, 2010

how to fix framework names being displayed in red in Xcode

Sometimes you'll find that the framework names in some of your Xcode projects show up in red. This happens in versions as new as 3.2.4, it may be fixed in future versions. I wasn't able to find a definitive reason of why that happens, some people were suggesting that Xcode was not able to find those frameworks, but if that were the case, my project should have never built, and I had no issues building.

I think it's more likely a bug in Xcode, which stems from the fact that you can change the build settings, namely the base SDK, from multiple places.

One way is to select the current target from the "Groups & Files" pane, and do a File->Get Info, then select the "Build" tab, then pick the configuration you want to change, from the "Configuration:" list.

Another way is to go to Project->Edit Project Settings, then select the "Build" tab and do the same as above.

Yet another way to change the base SDK is to go to Project->Edit Project Settings, then select the "General" tab, then at the bottom of the screen there is a "Base SDK for All Configurations".

The bottom line is that you should make sure you have the proper base SDK set in all 3 places, for all configurations of interest. In my case I had a "missing SDK" on the third place, and that was painting the frameworks name in red, evan as the project would build fine.

No comments: