How to fix “Use of undeclared identifier NSFoundationVersionNumber_iOS_6_1” error in Xcode 5

This can happen when you try to run code built for iOS 7 Base SDK on Xcode 4.x, or if you compile against an older Base SDK in Xcode 5.

The solution is to define what isn’t defined manually using a Macro. Add this to every class that’s complaining and you should be fine:


This tells the compiler to define the value if it’s not there, so it has no reason to complain.

How do I know that I’ve got more than one Base SDK?

You can check this either by connecting a device, and see if it appears twice. If it does, then it means Xcode lets you choose which SDK to compile against (the newest one is at the bottom):

Screen Shot 2013-11-12 at 16.15.02

Alternatively you can check under Build Settings, find a drop-down menu called Base SDK. I’ve explained more about how to install an older Base SDK here:

Kudos to this unrelated thread on GitHub:

Full list of all version numbers in Apple’s Foundation Constants Reference Guide:


About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.