The advice from Apple is to always set the Base SDK for iPhone/iPad projects to the latest installed version of the OS. At the current time this would be iOS 4.0, although 4.0 is only just about to be released so the vast majority of users will still be using 3.X. Obviously there will be features and functions available in 4.0 which don't exist in 3.X, however I would still like to support 3.X users for obvious reasons.
Suppose I am using some 4.0 specific features. If my Base SDK is set to 4.0 and my deployment target is set to 3.1.X, my project will compile just fine. However, unless I've got specific code in there testing to see if certain features can be used, I will experience a crash on 3.1.X.
But what if I don't know that this function doesn't exist in 3.1.X? Will I only find this out by experiencing a crash on that particular screen? What if the function is buried deep within my app, or only appears in very specific situations? Or what if I'm a new developer who starts coding on 4.0, and doesn't really know the ins and outs of 3.X? I suppose the obvious answer would be to set the deployment target for 4.0, but I suspect a lot of end users will be sticking on 3.1.X for a while so that's not ideal.
Am I missing something about how this all works? Of course I need to test my app fully in 3.1.X, but it seems crazy that I don't get any sort of compiler assistance. It's really not that inconceivable that something will slip through at some point. Perhaps I can temporarily set the Base SDK back to 3.1.X every now and again?